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

Commit ed12614

Browse files
committed
Add a script to run node-qunit-phantomjs.
1 parent 7e3d9f8 commit ed12614

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

build/phantom.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/* eslint-env node */
2+
3+
'use strict';
4+
5+
var os = require('os');
6+
var glob = require('glob');
7+
var async = require('async');
8+
var qunit = require('node-qunit-phantomjs');
9+
10+
var THREADS = os.cpus().length <= 2 ? 1 : os.cpus().length / 2;
11+
12+
var ignores = [
13+
'test/fixtures/jquery/missing.html',
14+
'test/fixtures/jquery/and_bs_js_both_missing.html',
15+
'test/fixtures/charset/not-utf8.html'
16+
];
17+
18+
glob('test/fixtures/**/*.html', {ignore: ignores}, function (err, files) {
19+
if (err) {
20+
throw err;
21+
}
22+
23+
async.eachLimit(files,
24+
THREADS,
25+
function (file, callback) {
26+
qunit(file, {timeout: 10}, callback);
27+
}, function (er) {
28+
if (er) {
29+
throw er;
30+
}
31+
});
32+
});

package-lock.json

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"eslint": "eslint \"**/*.js\"",
4141
"lint": "npm run eslint",
4242
"nodeunit": "nodeunit test",
43-
"qunit": "node-qunit-phantomjs \"test/fixtures/**/*.html\" --timeout=10",
43+
"qunit": "node build/phantom.js",
4444
"start": "node ./bin/www",
4545
"test": "npm run eslint && npm run dist && npm run nodeunit && npm run qunit",
4646
"travis": "nyc npm test"
@@ -60,6 +60,7 @@
6060
"void-elements": "^3.1.0"
6161
},
6262
"devDependencies": {
63+
"async": "^2.6.0",
6364
"browserify": "^14.5.0",
6465
"coveralls": "^3.0.0",
6566
"eslint": "^4.11.0",

0 commit comments

Comments
 (0)