Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

fix: TypeScript file detection #56

Draft
wants to merge 39 commits into
base: develop
Choose a base branch
from
Draft

Conversation

privatenumber
Copy link
Member

@privatenumber privatenumber commented Feb 12, 2023

Previously, detecting a TypeScript file was purely based on the file extension. However, it's possible that allowJs is set in tsconfig.json so it's not limited to files with TS extensions.

closes privatenumber/tsx#344
closes #40
addresses half of privatenumber/tsx#135

describe('From TypeScript file', ({ describe }) => {
describe('with allowJs', async ({ test, onFinish }) => {
const fixture = await createFixture({
'import.mts': importAndLog('./file.mjs'),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confused. file.mts isn't actually a JS file so why does it require allowJs to be enabled?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Importing a typescript file from a js file using extension fails.
1 participant