Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.

Commit

Permalink
Add a script to run node-qunit-phantomjs.
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Nov 20, 2017
1 parent 7e3d9f8 commit ed12614
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
32 changes: 32 additions & 0 deletions build/phantom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/* eslint-env node */

'use strict';

var os = require('os');
var glob = require('glob');
var async = require('async');
var qunit = require('node-qunit-phantomjs');

var THREADS = os.cpus().length <= 2 ? 1 : os.cpus().length / 2;

var ignores = [
'test/fixtures/jquery/missing.html',
'test/fixtures/jquery/and_bs_js_both_missing.html',
'test/fixtures/charset/not-utf8.html'
];

glob('test/fixtures/**/*.html', {ignore: ignores}, function (err, files) {
if (err) {
throw err;
}

async.eachLimit(files,
THREADS,
function (file, callback) {
qunit(file, {timeout: 10}, callback);
}, function (er) {
if (er) {
throw er;
}
});
});
9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"eslint": "eslint \"**/*.js\"",
"lint": "npm run eslint",
"nodeunit": "nodeunit test",
"qunit": "node-qunit-phantomjs \"test/fixtures/**/*.html\" --timeout=10",
"qunit": "node build/phantom.js",
"start": "node ./bin/www",
"test": "npm run eslint && npm run dist && npm run nodeunit && npm run qunit",
"travis": "nyc npm test"
Expand All @@ -60,6 +60,7 @@
"void-elements": "^3.1.0"
},
"devDependencies": {
"async": "^2.6.0",
"browserify": "^14.5.0",
"coveralls": "^3.0.0",
"eslint": "^4.11.0",
Expand Down

0 comments on commit ed12614

Please sign in to comment.