Skip to content

Commit 7507671

Browse files
shudingnevilm-lt
authored andcommitted
add moduleNameMapper (vercel#1724)
1 parent 9bed06c commit 7507671

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

jest.config.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,20 @@ module.exports = {
33
testRegex: '/test/.*\\.test\\.tsx?$',
44
modulePathIgnorePatterns: ['<rootDir>/examples/'],
55
setupFilesAfterEnv: ['<rootDir>/scripts/jest-setup.ts'],
6+
moduleNameMapper: {
7+
'^swr$': '<rootDir>/src',
8+
'^swr/infinite$': '<rootDir>/infinite/index.ts',
9+
'^swr/immutable$': '<rootDir>/immutable/index.ts'
10+
},
611
transform: {
712
'^.+\\.(t|j)sx?$': [
813
'@swc-node/jest',
914
{
1015
jsc: {
11-
minify: false,
16+
minify: false
1217
}
13-
},
14-
],
18+
}
19+
]
1520
},
1621
coveragePathIgnorePatterns: ['/node_modules/', '/dist/', '/test/'],
1722
coverageProvider: 'v8',

0 commit comments

Comments
 (0)