Skip to content

Commit eb4951c

Browse files
authored
run npm with shell (microsoft#460)
1 parent b053f93 commit eb4951c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

test/test-integration.mjs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,18 @@ describe('integration tests', function () {
3131
});
3232

3333
//console.log('command-ts with test: Running npm install');
34-
const res = await doSpawn(npmCommand, ['i'], { cwd: runResult.env.cwd });
34+
const res = await doSpawn(npmCommand, ['i'], { cwd: runResult.env.cwd, shell: true });
3535
if (res.exitCode !== 0) {
3636
assert.fail(`npm installed failed: stdout ${res.stdout} stderr ${res.stderr}`);
3737
}
3838

39-
const resAudit = await doSpawn(npmCommand, ['audit'], { cwd: runResult.env.cwd });
39+
const resAudit = await doSpawn(npmCommand, ['audit'], { cwd: runResult.env.cwd, shell: true });
4040
if (resAudit.exitCode !== 0) {
4141
assert.fail(`npm audit failed: stdout ${resAudit.stdout} stderr ${resAudit.stderr}`);
4242
}
4343

4444
//console.log('command-ts with test: Running extension compile');
45-
const res2 = await doSpawn(npmCommand, ['run', 'test'], { cwd: runResult.env.cwd });
45+
const res2 = await doSpawn(npmCommand, ['run', 'test'], { cwd: runResult.env.cwd, shell: true });
4646
if (res2.exitCode !== 0) {
4747
assert.fail(`npm run test failed: stdout ${res2.stdout} stderr ${res2.stderr}`);
4848
}
@@ -64,18 +64,18 @@ describe('integration tests', function () {
6464
openWith: 'skip'
6565
});
6666

67-
const res = await doSpawn(npmCommand, ['i'], { cwd: runResult.env.cwd });
67+
const res = await doSpawn(npmCommand, ['i'], { cwd: runResult.env.cwd, shell: true });
6868
if (res.exitCode !== 0) {
6969
assert.fail(`npm installed failed: stdout ${res.stdout} stderr ${res.stderr}`);
7070
}
7171

72-
const resAudit = await doSpawn(npmCommand, ['audit'], { cwd: runResult.env.cwd });
72+
const resAudit = await doSpawn(npmCommand, ['audit'], { cwd: runResult.env.cwd, shell: true });
7373
if (resAudit.exitCode !== 0) {
7474
assert.fail(`npm audit failed: stdout ${resAudit.stdout} stderr ${resAudit.stderr}`);
7575
}
7676

7777
//console.log('command-ts-webpack with test: Running extension compile');
78-
const res2 = await doSpawn(npmCommand, ['run', 'test'], { cwd: runResult.env.cwd });
78+
const res2 = await doSpawn(npmCommand, ['run', 'test'], { cwd: runResult.env.cwd, shell: true });
7979
if (res2.exitCode !== 0) {
8080
assert.fail(`npm run compile failed: stdout ${res2.stdout} stderr ${res2.stderr}`);
8181
}
@@ -96,18 +96,18 @@ describe('integration tests', function () {
9696
openWith: 'skip'
9797
});
9898

99-
const res = await doSpawn(npmCommand, ['i'], { cwd: runResult.env.cwd });
99+
const res = await doSpawn(npmCommand, ['i'], { cwd: runResult.env.cwd, shell: true });
100100
if (res.exitCode !== 0) {
101101
assert.fail(`npm installed failed: stdout ${res.stdout} stderr ${res.stderr}`);
102102
}
103103

104-
const resAudit = await doSpawn(npmCommand, ['audit'], { cwd: runResult.env.cwd });
104+
const resAudit = await doSpawn(npmCommand, ['audit'], { cwd: runResult.env.cwd, shell: true });
105105
if (resAudit.exitCode !== 0) {
106106
assert.fail(`npm audit failed: stdout ${resAudit.stdout} stderr ${resAudit.stderr}`);
107107
}
108108

109109
//console.log('command-ts-web with test: Running extension compile-web');
110-
const res2 = await doSpawn(npmCommand, ['run', 'test'], { cwd: runResult.env.cwd });
110+
const res2 = await doSpawn(npmCommand, ['run', 'test'], { cwd: runResult.env.cwd, shell: true });
111111
if (res2.exitCode !== 0) {
112112
assert.fail(`npm run test failed: stdout ${res2.stdout} stderr ${res2.stderr}`);
113113
}

0 commit comments

Comments
 (0)