Skip to content

Commit aa7f103

Browse files
committed
(test): ensure custom --tsconfig path is correctly read
- 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 c12f92c commit aa7f103

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
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

+22
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,28 @@ describe('tsdx build', () => {
136136
expect(output.code).toBe(0);
137137
});
138138

139+
it('should read custom --tsconfig path', () => {
140+
util.setupStageWithFixture(stageName, 'build-withTsconfig');
141+
142+
const output = shell.exec(
143+
'node ../dist/index.js build --format cjs --tsconfig ./src/tsconfig.json'
144+
);
145+
146+
expect(shell.test('-f', 'dist/index.js')).toBeTruthy();
147+
expect(
148+
shell.test('-f', 'dist/build-withtsconfig.cjs.development.js')
149+
).toBeTruthy();
150+
expect(
151+
shell.test('-f', 'dist/build-withtsconfig.cjs.production.min.js')
152+
).toBeTruthy();
153+
154+
expect(shell.test('-f', 'dist/index.d.ts')).toBeFalsy();
155+
expect(shell.test('-f', 'typingsCustom/index.d.ts')).toBeTruthy();
156+
expect(shell.test('-f', 'typingsCustom/index.d.ts.map')).toBeTruthy();
157+
158+
expect(output.code).toBe(0);
159+
});
160+
139161
afterEach(() => {
140162
util.teardownStage(stageName);
141163
});

0 commit comments

Comments
 (0)