-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #211 from iambumblehead/resolve-tsx-failing-test
try resolve tsx failing test
- Loading branch information
Showing
7 changed files
with
45 additions
and
63 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 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 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,25 @@ | ||
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') | ||
}) | ||
|
||
// tsx fails :/ https://github.com/esbuild-kit/tsx/issues/264 | ||
// | ||
// test('should mock ts when using tsx - unknown file extension', async () => { | ||
// const main = await esmock('../local/main.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"type": "module", | ||
"description": "esmock unit tests, tsx with node", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/iambumblehead/esmock.git" | ||
}, | ||
"dependencies": { | ||
"esmock": "file:..", | ||
"tsx": "^3.12.7" | ||
}, | ||
"scripts": { | ||
"test": "node --loader=tsx --loader=esmock --test esmock.node.tsx.test.ts" | ||
} | ||
} |
File renamed without changes.