Skip to content

Commit 343cdc0

Browse files
author
Suchita Doshi
committed
use ember serve instead of yarn start
1 parent 61cc544 commit 343cdc0

3 files changed

Lines changed: 16 additions & 8 deletions

File tree

lib/gather/gather-single-telemetry.test.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ describe('Gather single telemetry', () => {
5454

5555
afterAll(async () => {
5656
console.log(`Killing PID: ${app.emberServe.pid}`);
57-
await app.emberServe.kill('SIGTERM', {
58-
forceKillAfterTimeout: 200,
59-
});
57+
await app.emberServe.shutdown();
6058
}, APP_TIMEOUT);
6159
});

lib/gather/gather-telemetry.test.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ describe('Provide a personalized `Gathering Function`', () => {
6969

7070
afterAll(async () => {
7171
console.log(`Killing PID: ${app.emberServe.pid}`);
72-
await app.emberServe.kill('SIGTERM', {
73-
forceKillAfterTimeout: 200,
74-
});
72+
await app.emberServe.shutdown();
7573
}, APP_TIMEOUT);
7674
});

test/helpers/start-app.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ const path = require('path');
33

44
module.exports = async function startApp(appPath) {
55
const classicAppDir = path.resolve(appPath);
6-
const execOpts = { cwd: classicAppDir, stderr: 'inherit' };
6+
const execOpts = { cwd: classicAppDir, stderr: 'inherit', preferLocal: true };
77
console.log('installing deps');
88

99
await execa('rm', ['-rf', 'node_modules'], execOpts);
1010
await execa('yarn', ['install'], execOpts);
1111

1212
console.log('starting serve');
13-
const emberServe = execa('yarn', ['start'], execOpts);
13+
const emberServe = execa('ember', ['serve'], execOpts);
1414
emberServe.stdout.pipe(process.stdout);
1515

1616
await new Promise(resolve => {
@@ -22,5 +22,17 @@ module.exports = async function startApp(appPath) {
2222
});
2323
});
2424

25+
emberServe.shutdown = async function() {
26+
this.kill();
27+
try {
28+
await this;
29+
} catch (e) {
30+
// Process is allowed to exit with a non zero exit status code.
31+
}
32+
if (!this.killed) {
33+
throw new Error(`the process ${this.pid} wasn't killed.`);
34+
}
35+
};
36+
2537
return { emberServe };
2638
};

0 commit comments

Comments
 (0)