testem 3.17.0 → 3.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/phantom.js +1 -1
- package/lib/api.js +1 -1
- package/lib/app.js +1 -1
- package/lib/browser_launcher.js +1 -1
- package/lib/browser_tap_consumer.js +1 -1
- package/lib/config.js +10 -7
- package/lib/file_watcher.js +1 -1
- package/lib/launcher-factory.js +1 -1
- package/lib/launcher.js +1 -1
- package/lib/process-ctl.js +17 -3
- package/lib/reporters/dev/constants.js +1 -1
- package/lib/reporters/dev/error_messages_panel.js +1 -1
- package/lib/reporters/dev/index.js +1 -1
- package/lib/reporters/dev/patchcharm.js +1 -1
- package/lib/reporters/dev/runner.js +1 -1
- package/lib/reporters/dev/runner_tabs.js +1 -1
- package/lib/reporters/dev/screen.js +1 -1
- package/lib/reporters/dev/scrollable_text_panel.js +1 -1
- package/lib/reporters/dev/split_log_panel.js +1 -1
- package/lib/reporters/dev/test_results.js +1 -1
- package/lib/reporters/dev/view.js +1 -1
- package/lib/reporters/dot_reporter.js +1 -1
- package/lib/reporters/index.js +1 -1
- package/lib/reporters/tap_reporter.js +1 -1
- package/lib/reporters/teamcity_reporter.js +1 -1
- package/lib/reporters/xunit_reporter.js +1 -1
- package/lib/runners/browser_test_runner.js +1 -1
- package/lib/runners/hook_runner.js +1 -1
- package/lib/runners/process_test_runner.js +2 -1
- package/lib/runners/tap_process_test_runner.js +1 -1
- package/lib/runners/to-result.js +1 -1
- package/lib/server/index.js +1 -1
- package/lib/tap_consumer.js +2 -2
- package/lib/utils/add-to-PATH.js +1 -1
- package/lib/utils/browser-args.js +1 -1
- package/lib/utils/capitalize.js +1 -1
- package/lib/utils/chars.js +1 -1
- package/lib/utils/clean_exit.js +1 -1
- package/lib/utils/current-time.js +1 -1
- package/lib/utils/displayutils.js +1 -1
- package/lib/utils/env-with-local-path.js +1 -1
- package/lib/utils/fileutils.js +11 -6
- package/lib/utils/is-node-lt.js +1 -1
- package/lib/utils/is-win.js +0 -2
- package/lib/utils/isa.js +1 -1
- package/lib/utils/known-browsers.js +3 -2
- package/lib/utils/log-entry.js +1 -1
- package/lib/utils/posix.js +13 -0
- package/lib/utils/process.js +18 -7
- package/lib/utils/report-file.js +1 -1
- package/lib/utils/reporter.js +1 -1
- package/lib/utils/run-timeout.js +1 -1
- package/lib/utils/signal-listeners.js +1 -1
- package/lib/utils/strutils.js +1 -1
- package/package.json +12 -12
- package/testem.js +1 -1
package/assets/phantom.js
CHANGED
package/lib/api.js
CHANGED
package/lib/app.js
CHANGED
package/lib/browser_launcher.js
CHANGED
package/lib/config.js
CHANGED
|
@@ -7,14 +7,14 @@ This object returns all config info for the app. It handles reading the `testem.
|
|
|
7
7
|
or `testem.json` config file.
|
|
8
8
|
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
|
|
12
12
|
const os = require('os');
|
|
13
13
|
const fs = require('fs');
|
|
14
14
|
const yaml = require('js-yaml');
|
|
15
15
|
const log = require('npmlog');
|
|
16
16
|
const path = require('path');
|
|
17
|
-
const glob = require('glob');
|
|
17
|
+
const glob = require('glob').glob;
|
|
18
18
|
const url = require('url');
|
|
19
19
|
const querystring = require('querystring');
|
|
20
20
|
const Bluebird = require('bluebird');
|
|
@@ -28,7 +28,8 @@ const fileExists = require('./utils/fileutils').fileExists;
|
|
|
28
28
|
const _ = require('lodash');
|
|
29
29
|
|
|
30
30
|
const knownBrowsers = require('./utils/known-browsers');
|
|
31
|
-
const
|
|
31
|
+
const { convertToPosix } = require('./utils/posix');
|
|
32
|
+
const globAsync = glob;
|
|
32
33
|
|
|
33
34
|
class Config {
|
|
34
35
|
constructor(appMode, progOptions, config) {
|
|
@@ -409,10 +410,12 @@ class Config {
|
|
|
409
410
|
return allThatIWant.concat({ src: pattern, attrs: attrs });
|
|
410
411
|
}
|
|
411
412
|
|
|
412
|
-
return globAsync(this.resolvePath(pattern), { ignore: dontWant
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
413
|
+
return globAsync(convertToPosix(this.resolvePath(pattern)), { ignore: dontWant.map(convertToPosix) })
|
|
414
|
+
.then(files => files.sort())
|
|
415
|
+
.then(files => allThatIWant.concat(files.map(f => {
|
|
416
|
+
f = this.reverseResolvePath(f);
|
|
417
|
+
return { src: f, attrs: attrs };
|
|
418
|
+
})));
|
|
416
419
|
}, [])
|
|
417
420
|
.then(result => _.uniqBy(result, 'src'))
|
|
418
421
|
.asCallback(callback);
|
package/lib/file_watcher.js
CHANGED
package/lib/launcher-factory.js
CHANGED
package/lib/launcher.js
CHANGED
package/lib/process-ctl.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
|
|
3
3
|
const log = require('npmlog');
|
|
4
|
-
const execa = require('execa');
|
|
4
|
+
const execa = require('execa').execa;
|
|
5
5
|
const Bluebird = require('bluebird');
|
|
6
6
|
const util = require('util');
|
|
7
7
|
const EventEmitter = require('events').EventEmitter;
|
|
@@ -11,6 +11,7 @@ const _ = require('lodash');
|
|
|
11
11
|
const envWithLocalPath = require('./utils/env-with-local-path');
|
|
12
12
|
const fileutils = require('./utils/fileutils');
|
|
13
13
|
const Process = require('./utils/process');
|
|
14
|
+
const isWin = require('./utils/is-win')();
|
|
14
15
|
|
|
15
16
|
const fileExists = fileutils.fileExists;
|
|
16
17
|
const executableExists = fileutils.executableExists;
|
|
@@ -37,7 +38,20 @@ module.exports = class ProcessCtl extends EventEmitter {
|
|
|
37
38
|
|
|
38
39
|
_spawn(exe, args, options) {
|
|
39
40
|
log.info('spawning: ' + exe + ' - ' + util.inspect(args));
|
|
40
|
-
|
|
41
|
+
|
|
42
|
+
// promise should always succeed, Process will uses .on('error') to handle errors
|
|
43
|
+
let process = execa(exe, args, Object.assign({ reject: false }, options));
|
|
44
|
+
|
|
45
|
+
process.then(result => {
|
|
46
|
+
if (result.failed && result.exitCode !== 0 &&
|
|
47
|
+
result.shortMessage.includes(isWin ? 'is not recognized' : 'ENOENT'))
|
|
48
|
+
{
|
|
49
|
+
this.emit('processError', new Error(result.shortMessage), result.stdout, result.stderr);
|
|
50
|
+
}
|
|
51
|
+
return Promise.resolve(result);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
let p = new Process(this.name, { killTimeout: this.killTimeout }, process);
|
|
41
55
|
this.emit('processStarted', p);
|
|
42
56
|
return Bluebird.resolve(p);
|
|
43
57
|
}
|
package/lib/reporters/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
var Bluebird = require('bluebird');
|
|
3
3
|
|
|
4
4
|
var toResult = require('./to-result');
|
|
@@ -21,6 +21,7 @@ class ProcessTestRunner {
|
|
|
21
21
|
this.process = testProcess;
|
|
22
22
|
this.process.once('processExit', this.onProcessExit.bind(this));
|
|
23
23
|
this.process.once('processError', this.onProcessError.bind(this));
|
|
24
|
+
return Promise.resolve(testProcess);
|
|
24
25
|
}).catch(reject);
|
|
25
26
|
}).asCallback(onFinish);
|
|
26
27
|
}
|
package/lib/runners/to-result.js
CHANGED
package/lib/server/index.js
CHANGED
package/lib/tap_consumer.js
CHANGED
package/lib/utils/add-to-PATH.js
CHANGED
package/lib/utils/capitalize.js
CHANGED
package/lib/utils/chars.js
CHANGED
package/lib/utils/clean_exit.js
CHANGED
package/lib/utils/fileutils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
|
|
3
3
|
const fs = require('fs');
|
|
4
|
-
const execa = require('execa');
|
|
4
|
+
const execa = require('execa').execa;
|
|
5
5
|
const Bluebird = require('bluebird');
|
|
6
6
|
const log = require('npmlog');
|
|
7
7
|
|
|
@@ -15,9 +15,14 @@ exports.fileExists = function fileExists(path) {
|
|
|
15
15
|
|
|
16
16
|
exports.executableExists = function executableExists(exe, options) {
|
|
17
17
|
let cmd = isWin ? 'where' : 'which';
|
|
18
|
-
let test = execa(cmd, [exe], options);
|
|
19
|
-
|
|
20
|
-
test.on('error', error => log.error('Error spawning "' + cmd + exe + '"', error));
|
|
18
|
+
let test = execa(cmd, [exe], Object.assign({ reject: false }, options));
|
|
21
19
|
|
|
22
|
-
return test.then(result =>
|
|
20
|
+
return test.then(result => {
|
|
21
|
+
if (result.exitCode === 0) {
|
|
22
|
+
return true;
|
|
23
|
+
} else if (!result.exitCode) {
|
|
24
|
+
log.error('Error spawning "' + cmd + ' ' + exe + '"', result);
|
|
25
|
+
}
|
|
26
|
+
return false;
|
|
27
|
+
});
|
|
23
28
|
};
|
package/lib/utils/is-node-lt.js
CHANGED
package/lib/utils/is-win.js
CHANGED
package/lib/utils/isa.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
|
|
3
3
|
const browserArgs = require('./browser-args');
|
|
4
4
|
const path = require('path');
|
|
@@ -84,6 +84,7 @@ function firefoxPaths() {
|
|
|
84
84
|
return [
|
|
85
85
|
'C:\\Program Files\\Mozilla Firefox\\firefox.exe',
|
|
86
86
|
'C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe',
|
|
87
|
+
'C:\\Users\\' + process.env.USERNAME + '\\AppData\\Local\\Mozilla Firefox\\firefox.exe',
|
|
87
88
|
process.env.HOME + '/Applications/Firefox.app/Contents/MacOS/firefox',
|
|
88
89
|
'/Applications/Firefox.app/Contents/MacOS/firefox'
|
|
89
90
|
];
|
|
@@ -144,7 +145,7 @@ module.exports = function knownBrowsers(platform, config) {
|
|
|
144
145
|
possibleExe: 'firefox',
|
|
145
146
|
|
|
146
147
|
args(config, url) {
|
|
147
|
-
return ['-profile', '
|
|
148
|
+
return ['-profile', '-headless', this.browserTmpDir(), url];
|
|
148
149
|
},
|
|
149
150
|
setup(config, done) {
|
|
150
151
|
firefoxSetup(this.browserTmpDir(), config, done);
|
package/lib/utils/log-entry.js
CHANGED
package/lib/utils/process.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const execa = require('execa');
|
|
1
|
+
const execa = require('execa').execa;
|
|
4
2
|
const log = require('npmlog');
|
|
5
3
|
const Bluebird = require('bluebird');
|
|
6
4
|
const EventEmitter = require('events').EventEmitter;
|
|
@@ -29,6 +27,15 @@ module.exports = class Process extends EventEmitter {
|
|
|
29
27
|
|
|
30
28
|
this.process.on('close', this.onClose.bind(this));
|
|
31
29
|
this.process.on('error', this.onError.bind(this));
|
|
30
|
+
|
|
31
|
+
this.process.then(result => {
|
|
32
|
+
if (result.failed && result.exitCode !== 0 &&
|
|
33
|
+
result.shortMessage.includes(isWin ? 'is not recognized' : 'ENOENT'))
|
|
34
|
+
{
|
|
35
|
+
this.onError(new Error(result.shortMessage), this.stdout, this.stderr);
|
|
36
|
+
}
|
|
37
|
+
return Promise.resolve(result);
|
|
38
|
+
});
|
|
32
39
|
}
|
|
33
40
|
|
|
34
41
|
onKillTimeout() {
|
|
@@ -48,7 +55,7 @@ module.exports = class Process extends EventEmitter {
|
|
|
48
55
|
|
|
49
56
|
onError(error) {
|
|
50
57
|
log.warn(this.name + ' errored', error);
|
|
51
|
-
this.process = null;
|
|
58
|
+
// this.process = null;
|
|
52
59
|
this.exitCode = 1;
|
|
53
60
|
this.emit('processError', error, this.stdout, this.stderr);
|
|
54
61
|
}
|
|
@@ -132,14 +139,18 @@ function kill(p, sig) {
|
|
|
132
139
|
args.push('/f');
|
|
133
140
|
}
|
|
134
141
|
|
|
135
|
-
execa(command, args
|
|
142
|
+
const killProcess = execa(command, args, { reject: false });
|
|
143
|
+
|
|
144
|
+
killProcess.on('error', err => {
|
|
145
|
+
log.error(err);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
killProcess.then(result => {
|
|
136
149
|
// Processes without windows can't be killed without /F, detect and force
|
|
137
150
|
// kill them directly
|
|
138
151
|
if (result.stderr.indexOf('can only be terminated forcefully') !== -1) {
|
|
139
152
|
kill(p, 'SIGKILL');
|
|
140
153
|
}
|
|
141
|
-
}).catch(err => {
|
|
142
|
-
log.error(err);
|
|
143
154
|
});
|
|
144
155
|
} else {
|
|
145
156
|
p.kill(sig);
|
package/lib/utils/report-file.js
CHANGED
package/lib/utils/reporter.js
CHANGED
package/lib/utils/run-timeout.js
CHANGED
package/lib/utils/strutils.js
CHANGED
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"unittest",
|
|
8
8
|
"browser"
|
|
9
9
|
],
|
|
10
|
-
"version": "3.
|
|
10
|
+
"version": "3.19.0",
|
|
11
11
|
"author": "Toby Ho <airportyh@gmail.com>",
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"commander": "^2.6.0",
|
|
29
29
|
"compression": "^1.7.4",
|
|
30
30
|
"consolidate": "^0.16.0",
|
|
31
|
-
"execa": "^
|
|
31
|
+
"execa": "^9.6.1",
|
|
32
32
|
"express": "^4.10.7",
|
|
33
33
|
"fireworm": "^0.7.2",
|
|
34
|
-
"glob": "^
|
|
34
|
+
"glob": "^13.0.6",
|
|
35
35
|
"http-proxy": "^1.13.1",
|
|
36
36
|
"js-yaml": "^3.2.5",
|
|
37
37
|
"lodash": "^4.17.21",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"node-notifier": "^10.0.0",
|
|
41
41
|
"npmlog": "^6.0.0",
|
|
42
42
|
"printf": "^0.6.1",
|
|
43
|
-
"rimraf": "^
|
|
43
|
+
"rimraf": "^6.1.3",
|
|
44
44
|
"socket.io": "^4.5.4",
|
|
45
45
|
"spawn-args": "^0.2.0",
|
|
46
46
|
"styled_string": "0.0.1",
|
|
47
47
|
"tap-parser": "^7.0.0",
|
|
48
|
-
"tmp": "0.
|
|
48
|
+
"tmp": "^0.2.5"
|
|
49
49
|
},
|
|
50
50
|
"files": [
|
|
51
51
|
"lib",
|
|
@@ -67,20 +67,20 @@
|
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"bluebird-retry": "^0.11.0",
|
|
69
69
|
"browserify": "^17.0.0",
|
|
70
|
-
"chai": "^
|
|
70
|
+
"chai": "^6.2.2",
|
|
71
71
|
"chai-files": "^1.2.0",
|
|
72
72
|
"chai-shallow-deep-equal": "^1.4.4",
|
|
73
73
|
"cheerio": "1.0.0-rc.12",
|
|
74
|
-
"dirty-chai": "^
|
|
75
|
-
"eslint": "^
|
|
76
|
-
"eslint-plugin-chai-expect": "^3.
|
|
77
|
-
"eslint-plugin-mocha": "^
|
|
78
|
-
"mocha": "^
|
|
74
|
+
"dirty-chai": "^3.0.0",
|
|
75
|
+
"eslint": "^9.39.4",
|
|
76
|
+
"eslint-plugin-chai-expect": "^3.1.0",
|
|
77
|
+
"eslint-plugin-mocha": "^11.2.0",
|
|
78
|
+
"mocha": "^11.7.5",
|
|
79
79
|
"request": "^2.51.0",
|
|
80
80
|
"saucie": "^3.3.3",
|
|
81
81
|
"shelljs": "^0.8.2",
|
|
82
82
|
"sinon": "10.0.0",
|
|
83
|
-
"sinon-chai": "^
|
|
83
|
+
"sinon-chai": "^4.0.1",
|
|
84
84
|
"socket.io-client": "^4.1.2",
|
|
85
85
|
"tape": "^5.2.2"
|
|
86
86
|
},
|
package/testem.js
CHANGED