Skip to content

Commit 3f652f7

Browse files
authored
fix: use correct working directory for CLI test (#1703)
1 parent 9b2e112 commit 3f652f7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/rtk-query-codegen-openapi/test/cli.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ import path from 'path';
55
import del from 'del';
66

77
function cli(args: string[], cwd: string): Promise<{ error: ExecException | null; stdout: string; stderr: string }> {
8-
const cmd = `${require.resolve('ts-node/dist/bin')} -T -P ${path.resolve('./tsconfig.json')} ${path.resolve(
9-
'./src/bin/cli.ts'
8+
const pwd = (process.env && process.env.PWD) || '.';
9+
const cmd = `${require.resolve('ts-node/dist/bin')} -T -P ${path.resolve(pwd, 'tsconfig.json')} ${path.resolve(
10+
pwd,
11+
'src/bin/cli.ts'
1012
)} ${args.join(' ')}`;
1113
return new Promise((resolve) => {
1214
exec(cmd, { cwd }, (error, stdout, stderr) => {

0 commit comments

Comments
 (0)