-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
Copy pathrun-browserstack-tests.js
executable file
·47 lines (40 loc) · 1.15 KB
/
run-browserstack-tests.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* eslint-disable no-console */
const execa = require('execa');
const chalk = require('chalk');
function run(command, args = []) {
console.log(chalk.dim('$ ' + command + ' ' + args.join(' ')));
let p = execa(command, args);
p.stdout.pipe(process.stdout);
p.stderr.pipe(process.stderr);
return p;
}
(async function () {
await run('ember', ['browserstack:connect']);
try {
try {
// Calling testem directly here instead of `ember test` so that
// we do not have to do a double build (by the time this is run
// we have already ran `ember build`).
await run('testem', [
'ci',
'-f',
'testem.browserstack.js',
'--host',
'127.0.0.1',
'--port',
'7774',
]);
console.log('success');
process.exit(0); // eslint-disable-line n/no-process-exit
} finally {
if (process.env.GITHUB_RUN_ID) {
await run('ember', ['browserstack:results']);
}
await run('ember', ['browserstack:disconnect']);
}
} catch (error) {
console.log('error');
console.log(error);
process.exit(1); // eslint-disable-line n/no-process-exit
}
})();