Skip to content

Commit b277bf3

Browse files
authored
Merge pull request #465 from jcppkkk/fix-tests
Fix tests
2 parents b3700ae + 83b6e0b commit b277bf3

File tree

6 files changed

+405
-64
lines changed

6 files changed

+405
-64
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ uncaughtExceptions.log
1111
src/*.json
1212
.idea
1313
test.ts
14-
notes.md
14+
notes.md
15+
.nvmrc

jest.config.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,32 @@ const config: Config = {
99
testTimeout: 100_000,
1010
coverageProvider: 'v8',
1111
moduleDirectories: ['node_modules', 'src'],
12-
preset: 'ts-jest/presets/js-with-ts-esm',
12+
preset: 'ts-jest/presets/default-esm',
1313
setupFilesAfterEnv: ['<rootDir>/test/jest-setup.ts'],
1414
testEnvironment: 'node',
1515
testRegex: ['.*\\.test\\.ts$'],
16-
transformIgnorePatterns: ['node_modules/(?!cli-testing-library)'],
16+
transformIgnorePatterns: [
17+
'node_modules/(?!(cli-testing-library|@clack|cleye)/.*)'
18+
],
1719
transform: {
18-
'^.+\\.(ts|tsx)$': [
20+
'^.+\\.(ts|tsx|js|jsx|mjs)$': [
1921
'ts-jest',
2022
{
2123
diagnostics: false,
22-
useESM: true
24+
useESM: true,
25+
tsconfig: {
26+
module: 'ESNext',
27+
target: 'ES2022'
28+
}
2329
}
2430
]
31+
},
32+
// Fix Haste module naming collision
33+
modulePathIgnorePatterns: [
34+
'<rootDir>/test/e2e/prompt-module/data/'
35+
],
36+
moduleNameMapper: {
37+
'^(\\.{1,2}/.*)\\.js$': '$1'
2538
}
2639
};
2740

0 commit comments

Comments
 (0)