Skip to content

Commit 3519f5a

Browse files
committed
fix(jest.config.ts): update transformIgnorePatterns to include additional packages for transformation
fix(jest-setup.ts): ensure proper import syntax and maintain consistent formatting The transformIgnorePatterns in the Jest configuration now includes additional packages, allowing them to be transformed correctly. This change helps prevent issues with testing libraries that require transformation. Additionally, the import statements in jest-setup.ts have been corrected for consistency, and the configuration for asyncUtilTimeout is now properly formatted, enhancing readability and maintainability.
1 parent 41564fe commit 3519f5a

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

jest.config.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ const config: Config = {
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: {
1820
'^.+\\.(ts|tsx)$': [
1921
'ts-jest',
@@ -22,7 +24,11 @@ const config: Config = {
2224
useESM: true
2325
}
2426
]
25-
}
27+
},
28+
// Fix Haste module naming collision
29+
modulePathIgnorePatterns: [
30+
'<rootDir>/test/e2e/prompt-module/data/'
31+
]
2632
};
2733

2834
export default config;

test/jest-setup.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import 'cli-testing-library/extend-expect'
2-
import { configure } from 'cli-testing-library'
31
import { jest } from '@jest/globals';
2+
import 'cli-testing-library/extend-expect';
3+
import { configure } from 'cli-testing-library';
44

55
global.jest = jest;
66

77
/**
88
* Adjusted the wait time for waitFor/findByText to 2000ms, because the default 1000ms makes the test results flaky
99
*/
10-
configure({ asyncUtilTimeout: 2000 })
10+
configure({ asyncUtilTimeout: 2000 });

0 commit comments

Comments
 (0)