-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update test and README about tsx compatibility
tsx has been compatible with other loaders since around the end of 3.x and the start of 4.x when the aforementioned issue privatenumber/tsx#264 was resolved. Update the test to use a newer version of tsx which does not exhibit the bug and the README to say tsx is compatible.
- Loading branch information
Showing
5 changed files
with
31 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import test from 'node:test' | ||
import assert from 'assert' | ||
import esmock from 'esmock' | ||
|
||
test('should mock js when using tsx', async () => { | ||
const main = await esmock('../local/main.js', { | ||
path: { | ||
basename: () => 'hellow' | ||
} | ||
}) | ||
|
||
assert.strictEqual(main.pathbasenamewrap(), 'hellow') | ||
}) | ||
|
||
test('should mock ts when using tsx', async () => { | ||
const main = await esmock('../local/main-ts.ts', { | ||
path: { | ||
basename: () => 'hellow' | ||
} | ||
}) | ||
|
||
assert.strictEqual(main.pathbasenamewrap(), 'hellow') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters