-
Notifications
You must be signed in to change notification settings - Fork 455
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: revert support implementation for
Node16/NodeNext
- For CJS mode, `module` is always `CommonJS` - For ESM mode, `module` with value `Node16/NodeNext` will use `ESNext`, otherwise use the value provided by test `tsconfig` - `moduleResolution` is always `Node10`
- Loading branch information
Showing
8 changed files
with
77 additions
and
21 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,11 +1,18 @@ | ||
import path from 'path' | ||
|
||
import { json as runWithJson } from '../run-jest' | ||
import { runNpmInstall } from '../utils' | ||
|
||
beforeAll(() => { | ||
runNpmInstall(path.join(__dirname, '..', 'native-esm-ts')) | ||
}) | ||
|
||
test('runs TS test with native ESM', () => { | ||
const { exitCode, json } = runWithJson('native-esm-ts', [], { | ||
const { exitCode, json } = runWithJson('native-esm-ts', ['--no-cache'], { | ||
nodeOptions: '--experimental-vm-modules --no-warnings', | ||
}) | ||
|
||
expect(exitCode).toBe(0) | ||
expect(json.numTotalTests).toBe(4) | ||
expect(json.numPassedTests).toBe(4) | ||
expect(json.numTotalTests).toBe(6) | ||
expect(json.numPassedTests).toBe(6) | ||
}) |
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,16 @@ | ||
import path from 'node:path' | ||
|
||
import { it, describe, expect } from '@jest/globals' | ||
|
||
import { fileName } from '../third-parties/dirname-filename-esm.js' | ||
import { backend } from '../third-parties/i18next-fs-backend.js' | ||
|
||
describe('Third parties', () => { | ||
it('should work with i18next-fs-backend', () => { | ||
expect(backend).toBeDefined() | ||
}) | ||
|
||
it('should work with dirname-filename-esm', () => { | ||
expect(path.basename(fileName(import.meta))).toBe('third-party.spec.ts') | ||
}) | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
{ | ||
"type": "module", | ||
"devDependencies": { | ||
"@jest/globals": "^29.7.0" | ||
"@jest/globals": "^29.7.0", | ||
"dirname-filename-esm": "^1.1.2", | ||
"i18next-fs-backend": "^2.3.2" | ||
} | ||
} |
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,3 @@ | ||
import { filename } from 'dirname-filename-esm' | ||
|
||
export { filename as fileName } |
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,3 @@ | ||
import { default as Backend } from 'i18next-fs-backend' | ||
|
||
export const backend = new Backend() |
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