Skip to content

Commit 143e896

Browse files
shudingnevilm-lt
authored andcommitted
add moduleNameMapper (vercel#1724)
1 parent b6154bf commit 143e896

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

jest.config.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,21 @@ module.exports = {
22
testEnvironment: 'jsdom',
33
testRegex: '/test/.*\\.test\\.tsx?$',
44
modulePathIgnorePatterns: ['<rootDir>/examples/'],
5-
setupFilesAfterEnv: ['<rootDir>/test/jest-setup.ts'],
5+
setupFilesAfterEnv: ['<rootDir>/scripts/jest-setup.ts'],
66
moduleNameMapper: {
77
'^swr$': '<rootDir>/src',
88
'^swr/infinite$': '<rootDir>/infinite/index.ts',
99
'^swr/immutable$': '<rootDir>/immutable/index.ts'
1010
},
1111
transform: {
12-
'^.+\\.(t|j)sx?$': '@swc/jest'
12+
'^.+\\.(t|j)sx?$': [
13+
'@swc-node/jest',
14+
{
15+
jsc: {
16+
minify: false
17+
}
18+
}
19+
]
1320
},
1421
coveragePathIgnorePatterns: ['/node_modules/', '/dist/', '/test/'],
1522
coverageReporters: ['text', 'html']

0 commit comments

Comments
 (0)