-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from feelfreelinux/master
Add reading in of html "lang" property to html-metadata's parseGeneral method Bug: T148303
- Loading branch information
Showing
4 changed files
with
39 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
'use strict'; | ||
|
||
/** | ||
* Tests using externally scraped websites. May fail if resource at | ||
* location changes. | ||
*/ | ||
|
||
var meta = require('../index'); | ||
var assert = require('./utils/assert.js'); | ||
|
||
// mocha defines to avoid JSHint breakage | ||
/* global describe, it, before, beforeEach, after, afterEach */ | ||
|
||
describe('LangScraping', function() { | ||
|
||
this.timeout(40000); | ||
|
||
var url; | ||
|
||
describe('Lang parameter from external website', function() { | ||
it('should get hu parameter', function() { | ||
var expected = "hu"; | ||
var options = { | ||
url: "http://mno.hu/migr_1834/tellerlevel-cafolat-es-cafolat-700280", | ||
headers: { | ||
'User-Agent': 'webscraper' | ||
} | ||
}; | ||
return meta(options, function(error, metadata){ | ||
assert.deepEqual(metadata.general.lang, expected); | ||
}); | ||
}); | ||
}); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.