Skip to content

Commit efb3153

Browse files
committed
Fix test failures within VS Code
1 parent b229c8c commit efb3153

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

bin/index.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ const run = (args: string, ctrlcWrapper?: boolean) => {
5858
cwd: __dirname,
5959
env: {
6060
...process.env,
61+
// VS Code extension might allow colors, but this breaks assertions.
62+
// Force colors to be disabled to avoid that.
63+
FORCE_COLOR: '0',
6164
},
6265
});
6366

tests/smoke-tests.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ it('spawns binary', async () => {
1515

1616
it.each(['cjs-import', 'cjs-require', 'esm'])('loads library in %s context', async (project) => {
1717
// Use as separate execs as tsc outputs to stdout, instead of stderr, and so its text isn't shown
18-
await exec(`tsc -p ${project}`, { cwd: __dirname }).catch((err) => Promise.reject(err.stdout));
18+
await exec(`pnpm exec tsc -p ${project}`, { cwd: __dirname }).catch((err) =>
19+
Promise.reject(err),
20+
);
1921
await expect(
2022
exec(`node ${project}/dist/smoke-test.js`, { cwd: __dirname }),
2123
).resolves.toBeDefined();

0 commit comments

Comments
 (0)