Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit 9530a0c

Browse files
Parashuramjuliemr
Parashuram
authored andcommitted
(fix): Convert test.sh to test.js
This would enable the tests to be run on both Linux and Windows.
1 parent 8d57b1e commit 9530a0c

File tree

3 files changed

+44
-13
lines changed

3 files changed

+44
-13
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
},
4545
"main": "lib/protractor.js",
4646
"scripts": {
47-
"test": "scripts/test.sh"
47+
"test": "scripts/test.js"
4848
},
4949
"license": "MIT",
5050
"version": "0.20.1",

scripts/test.js

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env node
2+
3+
var glob = require('glob').sync;
4+
var spawn = require('child_process').spawn;
5+
6+
var scripts = [
7+
'lib/cli.js spec/basicConf.js',
8+
'lib/cli.js spec/multiConf.js',
9+
'lib/cli.js spec/altRootConf.js',
10+
'lib/cli.js spec/onPrepareConf.js',
11+
'lib/cli.js spec/mochaConf.js',
12+
'lib/cli.js spec/cucumberConf.js',
13+
'node lib/cli.js spec/withLoginConf.js',
14+
'node lib/cli.js spec/suitesConf.js --suite okmany',
15+
'node lib/cli.js spec/suitesConf.js'
16+
];
17+
18+
scripts.push(
19+
'node node_modules/.bin/minijasminenode jasminewd/spec/adapterSpec.js ' +
20+
glob('spec/unit/*.js').join(' ') + ' ' +
21+
glob('docs/spec/*.js').join(' '));
22+
23+
var failed = false;
24+
25+
(function runTests(i) {
26+
if (i < scripts.length) {
27+
console.log('node ' + scripts[i]);
28+
var args = scripts[i].split(/\s/);
29+
30+
var test = spawn(args[0], args.slice(1), {stdio: 'inherit'});
31+
test.on('error', function(err) {
32+
throw err;
33+
});
34+
test.on('exit', function(code) {
35+
if (code != 0) {
36+
failed = true;
37+
}
38+
runTests(i + 1);
39+
});
40+
} else {
41+
process.exit(failed ? 1 : 0);
42+
}
43+
}(0));

scripts/test.sh

-12
This file was deleted.

0 commit comments

Comments
 (0)