Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(524)

Unified Diff: tools/vulcanize/node_modules/vulcanize/node_modules/cheerio/node_modules/htmlparser2/tests/00-runtests.js

Issue 125733002: Add vulcanize to tools. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698