-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add additional test importing main-ts.ts
- Loading branch information
1 parent
a0b7de1
commit 4fb6be8
Showing
3 changed files
with
25 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,20 @@ | ||
import assert from 'node:assert' | ||
import test from 'node:test' | ||
import esmock from 'esmock' | ||
|
||
test('should import babelGeneratedDoubleDefault, cjs deep', async () => { | ||
const esmmain1 = await import ('./src/esmmain1.js') | ||
|
||
assert.ok('babelGeneratedDoubleDefaultResult' in esmmain1.default) | ||
}) | ||
|
||
test('should import ts when using tsx', async () => { | ||
// const main = await import ('./src/main-ts.ts') | ||
const main = await esmock('./src/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,19 @@ | ||
import assert from 'node:assert' | ||
import test from 'node:test' | ||
import esmock from 'esmock' | ||
|
||
test('should import babelGeneratedDoubleDefault, cjs deep', async () => { | ||
const esmmain1 = await import ('./src/esmmain1.js') | ||
|
||
assert.ok('babelGeneratedDoubleDefaultResult' in esmmain1.default) | ||
}) | ||
|
||
test('should import ts when using tsx', async () => { | ||
const main = await esmock('./src/main-ts.ts', { | ||
path: { | ||
basename: () => 'hellow' | ||
} | ||
}) | ||
|
||
assert.strictEqual(main.pathbasenamewrap(), 'hellow') | ||
}) |