Skip to content

Commit 7397f14

Browse files
Jake ChampionJakeChampion
authored andcommitted
use same executable to run the cli as the one which is running the tests
1 parent 92d9d6d commit 7397f14

11 files changed

+13
-12
lines changed

integration-tests/cli/custom-input-path.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test('should create wasm file and return zero exit code', async function (t) {
1414

1515
t.is(await exists('./bin/main.wasm'), false)
1616

17-
const { code, stdout, stderr } = await execute('node', `${cli} ${path}/index.js`);
17+
const { code, stdout, stderr } = await execute(process.execPath, `${cli} ${path}/index.js`);
1818

1919
t.is(await exists('./bin/main.wasm'), true)
2020
t.alike(stdout, []);

integration-tests/cli/custom-output-path.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test('should create output directory, wasm file and return zero exit code', asyn
1414

1515
t.is(await exists('./my/cool/app.wasm'), false)
1616

17-
const { code, stdout, stderr } = await execute('node', `${cli} ${path}/index.js ${path}/my/cool/app.wasm`);
17+
const { code, stdout, stderr } = await execute(process.execPath, `${cli} ${path}/index.js ${path}/my/cool/app.wasm`);
1818

1919
t.is(await exists('./my/cool/app.wasm'), true)
2020
t.alike(stdout, []);

integration-tests/cli/engine-wasm-path-is-not-a-file.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test('should return non-zero exit code', async function (t) {
1111
});
1212
await makeDir('./engine.wasm')
1313
await writeFile('./bin/index.js', `addEventListener('fetch', function(){})`)
14-
const { code, stdout, stderr } = await execute('node', `${cli} --engine-wasm ${path}/engine.wasm`);
14+
const { code, stdout, stderr } = await execute(process.execPath, `${cli} --engine-wasm ${path}/engine.wasm`);
1515

1616
t.alike(stdout, []);
1717
t.alike(stderr, ['Error: The `wasmEngine` path does not point to a file: {{base}}/engine.wasm']);

integration-tests/cli/help.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ test('--help should return help on stdout and zero exit code', async function (t
99
t.teardown(async function () {
1010
await cleanup();
1111
});
12+
const { code, stdout, stderr } = await execute(process.execPath, `${cli} --help`);
1213

1314
t.is(code, 0);
1415
t.alike(stdout, [
@@ -32,7 +33,7 @@ test('-h should return help on stdout and zero exit code', async function (t) {
3233
t.teardown(async function () {
3334
await cleanup();
3435
});
35-
const { code, stdout, stderr } = await execute('node',`${cli} -h`);
36+
const { code, stdout, stderr } = await execute(process.execPath, `${cli} -h`);
3637

3738
t.is(code, 0);
3839
t.alike(stdout, [

integration-tests/cli/input-path-is-not-a-file.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ test('should return non-zero exit code', async function (t) {
1010
await cleanup();
1111
});
1212
await makeDir('./bin/index.js')
13-
const { code, stdout, stderr } = await execute('node', cli);
13+
const { code, stdout, stderr } = await execute(process.execPath, cli);
1414

1515
t.alike(stdout, []);
1616
t.alike(stderr, ['Error: The `input` path does not point to a file: {{base}}/bin/index.js']);

integration-tests/cli/invalid.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ test('should return non-zero exit code on syntax errors', async function (t) {
1010
await cleanup();
1111
});
1212
await writeFile('./bin/index.js', '\n\n\n"hello";@')
13-
const { code, stdout, stderr } = await execute('node', cli);
13+
const { code, stdout, stderr } = await execute(process.execPath, cli);
1414
t.alike(stdout, []);
1515
t.alike(stderr, [
1616
'{{base}}/bin/index.js:4',

integration-tests/cli/non-existant-engine-wasm-path.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test('should return non-zero exit code', async function (t) {
1111
});
1212

1313
await writeFile('./bin/index.js', `addEventListener('fetch', function(){})`)
14-
const { code, stdout, stderr } = await execute('node', `${cli} --engine-wasm ${path}/engine.wasm`);
14+
const { code, stdout, stderr } = await execute(process.execPath, `${cli} --engine-wasm ${path}/engine.wasm`);
1515

1616
t.alike(stdout, []);
1717
t.alike(stderr, ['Error: The `wasmEngine` path points to a non-existant file: {{base}}/engine.wasm']);

integration-tests/cli/non-existant-input-path.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ test('should return non-zero exit code', async function (t) {
1010
await cleanup();
1111
});
1212

13-
const { code, stdout, stderr } = await execute('node', cli);
13+
const { code, stdout, stderr } = await execute(process.execPath, cli);
1414

1515
t.alike(stdout, []);
1616
t.alike(stderr, ['Error: The `input` path points to a non-existant file: {{base}}/bin/index.js']);

integration-tests/cli/output-path-is-not-a-file.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test('should return non-zero exit code', async function (t) {
1111
});
1212
await makeDir('./bin/main.wasm')
1313
await writeFile('./bin/index.js', `addEventListener('fetch', function(){})`)
14-
const { code, stdout, stderr } = await execute('node', cli);
14+
const { code, stdout, stderr } = await execute(process.execPath, cli);
1515

1616
t.alike(stdout, []);
1717
t.alike(stderr, ['Error: The `output` path does not point to a file: {{base}}/bin/main.wasm']);

integration-tests/cli/valid.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test('should create wasm file and return zero exit code', async function (t) {
1414

1515
t.is(await exists('./bin/main.wasm'), false)
1616

17-
const { code, stdout, stderr } = await execute('node', cli);
17+
const { code, stdout, stderr } = await execute(process.execPath, cli);
1818

1919
t.is(await exists('./bin/main.wasm'), true)
2020
t.alike(stdout, []);

0 commit comments

Comments
 (0)