Index: tools/vulcanize/node_modules/vulcanize/node_modules/cheerio/node_modules/htmlparser2/tests/00-runtests.js |
diff --git a/tools/vulcanize/node_modules/vulcanize/node_modules/cheerio/node_modules/htmlparser2/tests/00-runtests.js b/tools/vulcanize/node_modules/vulcanize/node_modules/cheerio/node_modules/htmlparser2/tests/00-runtests.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c8c51f7b32968f04cae0184093f597064f936ae6 |
--- /dev/null |
+++ b/tools/vulcanize/node_modules/vulcanize/node_modules/cheerio/node_modules/htmlparser2/tests/00-runtests.js |
@@ -0,0 +1,49 @@ |
+var fs = require("fs"), |
+ path = require("path"), |
+ assert = require("assert"); |
+ |
+var runCount = 0, |
+ testCount = 0, |
+ done = false; |
+ |
+[ |
+ "./01-events.js", |
+ "./02-stream.js", |
+ "./03-feed.js" |
+] |
+.map(require) |
+.forEach(function (test){ |
+ console.log("\nStarting", test.dir, "\n----"); |
+ |
+ var dir = path.resolve(__dirname, test.dir); |
+ |
+ //read files, load them, run them |
+ fs |
+ .readdirSync(dir) |
+ .filter(RegExp.prototype.test, /^[^\._]/) //ignore all files with a leading dot or underscore |
+ .map(function(name){ |
+ return path.resolve(dir, name); |
+ }) |
+ .map(require) |
+ .forEach(function(file){ |
+ runCount++; |
+ |
+ console.log("Testing:", file.name); |
+ |
+ var second = false; //every test runs twice |
+ test.test(file, function(err, dom){ |
+ assert.ifError(err); |
+ assert.deepEqual(file.expected, dom, "didn't get expected output"); |
+ |
+ if(second){ |
+ testCount++; |
+ if(!--runCount && done){ |
+ console.log("Total tests:", testCount); |
+ } |
+ } |
+ else second = true; |
+ }); |
+ }); |
+}); |
+ |
+var done = true; //started all tests |