Skip to content

Commit bf245d0

Browse files
agilgur5paul-vd
authored andcommitted
(test): ensure custom --tsconfig path is correctly read (jaredpalmer#556)
- this never had tests for it, so ensure it's properly read - make sure extends works, that an override works, and that paths are correctly resolved
1 parent e9f8e2b commit bf245d0

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
// ensure that extends works (trailing comma & comment too)
3+
"extends": "../tsconfig.base.json",
4+
"compilerOptions": {
5+
"declarationDir": "../typingsCustom/"
6+
}
7+
}

test/tests/tsdx-build.test.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,28 @@ describe('tsdx build', () => {
174174
expect(output.code).toBe(0);
175175
});
176176

177+
it('should read custom --tsconfig path', () => {
178+
util.setupStageWithFixture(stageName, 'build-withTsconfig');
179+
180+
const output = shell.exec(
181+
'node ../dist/index.js build --format cjs --tsconfig ./src/tsconfig.json'
182+
);
183+
184+
expect(shell.test('-f', 'dist/index.js')).toBeTruthy();
185+
expect(
186+
shell.test('-f', 'dist/build-withtsconfig.cjs.development.js')
187+
).toBeTruthy();
188+
expect(
189+
shell.test('-f', 'dist/build-withtsconfig.cjs.production.min.js')
190+
).toBeTruthy();
191+
192+
expect(shell.test('-f', 'dist/index.d.ts')).toBeFalsy();
193+
expect(shell.test('-f', 'typingsCustom/index.d.ts')).toBeTruthy();
194+
expect(shell.test('-f', 'typingsCustom/index.d.ts.map')).toBeTruthy();
195+
196+
expect(output.code).toBe(0);
197+
});
198+
177199
afterEach(() => {
178200
util.teardownStage(stageName);
179201
});

0 commit comments

Comments
 (0)