-
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.
changes to make switching test-runner or transpiler easier
- Loading branch information
1 parent
b43d115
commit 9a0a6b0
Showing
2 changed files
with
14 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,24 @@ | ||
// import test from 'node:test' | ||
import test from 'ava' | ||
import assert from 'assert' | ||
import esmock from 'esmock' | ||
|
||
test('should mock js when using tsx', async t => { | ||
test('should mock js when using tsx', async () => { | ||
const main = await esmock('../local/main.js', { | ||
path: { | ||
basename: () => 'hellow' | ||
} | ||
}) | ||
|
||
t.is(main.pathbasenamewrap(), 'hellow') | ||
assert.strictEqual(main.pathbasenamewrap(), 'hellow') | ||
}) | ||
|
||
test.only('should mock ts when using tsx - unknown file extension', async t => { | ||
test('should mock ts when using tsx - unknown file extension', async () => { | ||
const main = await esmock('../local/main.ts', { | ||
path: { | ||
basename: () => 'hellow' | ||
} | ||
}) | ||
|
||
t.is(main.pathbasenamewrap(), 'hellow') | ||
}) | ||
|
||
test.failing('should mock ts when using tsx - invalid moduleId', async t => { | ||
const main = await esmock('../local/mainUnique.js', { | ||
path: { | ||
basename: () => 'hellow' | ||
} | ||
}) | ||
|
||
t.is(main.pathbasenamewrap(), '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