Use a hard coded classesToPreserve in tests.
This commit is contained in:
parent
6729538c77
commit
d88c9afc63
@ -58,7 +58,9 @@ function runTestsWithItems(label, domGenerationFn, uri, source, expectedContent,
|
|||||||
before(function() {
|
before(function() {
|
||||||
try {
|
try {
|
||||||
var doc = domGenerationFn(source);
|
var doc = domGenerationFn(source);
|
||||||
var myReader = new Readability(uri, doc);
|
// Provide one class name to preserve, which we know appears in a few
|
||||||
|
// of the test documents.
|
||||||
|
var myReader = new Readability(uri, doc, { classesToPreserve: ["caption"] });
|
||||||
// Needs querySelectorAll function to test isProbablyReaderable method.
|
// Needs querySelectorAll function to test isProbablyReaderable method.
|
||||||
// jsdom implements querySelector but JSDOMParser doesn't.
|
// jsdom implements querySelector but JSDOMParser doesn't.
|
||||||
var readerable = label === "jsdom" ? myReader.isProbablyReaderable() : null;
|
var readerable = label === "jsdom" ? myReader.isProbablyReaderable() : null;
|
||||||
|
Loading…
Reference in New Issue
Block a user