-
-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: support TS resolution in JS files when allowJs
is set
#535
Changes from all commits
1632a30
86e33ea
c80ef6c
f4484fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -218,6 +218,14 @@ const files = { | |
|
||
'file.txt': 'hello', | ||
|
||
'import-typescript-parent.js': sourcemap.tag` | ||
import './import-typescript-child.js'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you move this inside There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can, though that will require adding There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah good point, let's keep it this way then. Thanks for catching it! |
||
`, | ||
|
||
'import-typescript-child.ts': sourcemap.tag` | ||
console.log('imported'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make this |
||
`, | ||
|
||
node_modules: { | ||
'pkg-commonjs': { | ||
'package.json': JSON.stringify({ | ||
|
@@ -663,6 +671,17 @@ export default testSuite(async ({ describe }, { tsx }: NodeApis) => { | |
expect(pTsconfigAllowJs.stderr).toMatch('Error: No error thrown'); | ||
expect(pTsconfigAllowJs.stdout).toBe(''); | ||
}); | ||
|
||
test('allowJs in tsconfig.json', async ({ onTestFail }) => { | ||
const pTsconfigAllowJs = await tsx(['--tsconfig', 'tsconfig/tsconfig-allowJs.json', 'import-typescript-parent.js'], fixture.path); | ||
onTestFail((error) => { | ||
console.error(error); | ||
console.log(pTsconfigAllowJs); | ||
}); | ||
expect(pTsconfigAllowJs.failed).toBe(false); | ||
expect(pTsconfigAllowJs.stderr).toBe(''); | ||
expect(pTsconfigAllowJs.stdout).toBe('imported'); | ||
}); | ||
}); | ||
}); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't fully understand how the tests are structured/split up; I'd be more than happy to adjust things here in response to feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For context, the idea behind the smoke tests here is to test with minimal number of child processes; the other tests are slow primarily because it spawns so many children.