Skip to content

Commit

Permalink
Reproduce issue for typed-ember#628
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Nov 7, 2023
1 parent 52fde5b commit d7f3aa0
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions packages/core/__tests__/cli/custom-extensions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ describe('CLI: custom extensions', () => {
'Greeting.gts': stripIndent`
<template>Hello!</template>
`,
're-export.gts': stripIndent`
export { default as Greeting } from './Greeting.gts';
`,
});
});

Expand All @@ -147,6 +150,11 @@ describe('CLI: custom extensions', () => {
1 import Greeting from './Greeting.gts';
~~~~~~~~~~~~~~~~
re-export.gts:1:37 - error TS2307: Cannot find module './Greeting.gts' or its corresponding type declarations.
1 export { default as Greeting } from './Greeting.gts';
~~~~~~~~~~~~~~~~
"
`);
});
Expand All @@ -165,5 +173,24 @@ describe('CLI: custom extensions', () => {
expect(result.stderr).toBe('');
}
);

test.runIf(semver.gte(typescript.version, '5.0.0'))(
'declarations work with `allowImportingTsExtensions: true`',
async () => {
project.updateTsconfig((config) => {
config.compilerOptions ??= {};
config.compilerOptions['allowImportingTsExtensions'] = true;
});

let emitResult = await project.check({ flags: ['--declaration'] });

expect(emitResult.exitCode).toBe(0);

expect(project.read('re-export.d.ts')).toMatchInlineSnapshot(`
"export { default as Greeting } from './Greeting';
"
`);
}
);
});
});

0 comments on commit d7f3aa0

Please sign in to comment.