From d88c9afc638dc5afcac0adf2840abfa84547d90b Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Tue, 21 Nov 2017 11:49:52 +0800 Subject: [PATCH] Use a hard coded classesToPreserve in tests. --- test/test-readability.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/test-readability.js b/test/test-readability.js index 3414467..14b0276 100644 --- a/test/test-readability.js +++ b/test/test-readability.js @@ -58,7 +58,9 @@ function runTestsWithItems(label, domGenerationFn, uri, source, expectedContent, before(function() { try { 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. // jsdom implements querySelector but JSDOMParser doesn't. var readerable = label === "jsdom" ? myReader.isProbablyReaderable() : null;