Skip to content

Commit

Permalink
test: add test case for custom tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
kazushisan committed Dec 16, 2024
1 parent f1baf97 commit b917842
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/fixtures/parse_args/tsconfig.main.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"include": ["src/main.ts"]
}
22 changes: 22 additions & 0 deletions test/parse_args.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,26 @@ export src/a.ts:2:0 'a2'
);
assert.equal(code, 1);
});

it('should work with custom tsconfig.json', async () => {
const { stdout, code } = await exec(
`node ${bin} --project tsconfig.main.json 'src/main\\.ts$'`,
{
cwd: projectRoot,
},
)
.then((res) => ({ ...res, code: 0 }))
.catch((e) => e as { stdout: string; code: number });

const output = stripAnsi(stdout.toString());

assert.equal(
output,
`tsconfig tsconfig.main.json
Project has 1 file. Found 1 entrypoint file
✔ all good!
`,
);
assert.equal(code, 0);
});
});

0 comments on commit b917842

Please sign in to comment.