Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
privatenumber committed Nov 19, 2024
1 parent 224476e commit a796a96
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions tests/specs/builds/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,23 +217,27 @@ export default testSuite(({ describe }, nodePath: string) => {
});

test('should pass custom tsconfig.json to dts module', async () => {
await using fixture = await createFixture({
const fixture = await createFixture({
...installTypeScript,
src: {
'index.ts': 'export default () => "foo";',
'index.tsx': 'export default () => (<div>hi</div>);',
},
'package.json': createPackageJson({
main: './dist/index.js',
types: './dist/index.d.ts',
dependencies: {
working: '*',
},
}),
'tsconfig.json': createTsconfigJson({
compilerOptions: {
incremental: true,
jsx: 'react-jsx',
jsxImportSource: 'not-working',
},
}),
'tsconfig.build.json': createTsconfigJson({
compilerOptions: {
incremental: false,
jsx: 'react-jsx',
jsxImportSource: 'working',
},
}),
});
Expand All @@ -249,6 +253,9 @@ export default testSuite(({ describe }, nodePath: string) => {

expect(pkgrollProcess.exitCode).toBe(0);
expect(pkgrollProcess.stderr).toBe('');

const code = await fixture.readFile('dist/index.js', 'utf8');
expect(code).toMatch('working');
});
});
});

0 comments on commit a796a96

Please sign in to comment.