Skip to content

Commit

Permalink
add moduleNameMapper (vercel#1724)
Browse files Browse the repository at this point in the history
  • Loading branch information
shuding authored and nevilm-lt committed Apr 22, 2022
1 parent 9bed06c commit 7507671
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions jest.config.js
Expand Up @@ -3,15 +3,20 @@ module.exports = {
testRegex: '/test/.*\\.test\\.tsx?$',
modulePathIgnorePatterns: ['<rootDir>/examples/'],
setupFilesAfterEnv: ['<rootDir>/scripts/jest-setup.ts'],
moduleNameMapper: {
'^swr$': '<rootDir>/src',
'^swr/infinite$': '<rootDir>/infinite/index.ts',
'^swr/immutable$': '<rootDir>/immutable/index.ts'
},
transform: {
'^.+\\.(t|j)sx?$': [
'@swc-node/jest',
{
jsc: {
minify: false,
minify: false
}
},
],
}
]
},
coveragePathIgnorePatterns: ['/node_modules/', '/dist/', '/test/'],
coverageProvider: 'v8',
Expand Down

0 comments on commit 7507671

Please sign in to comment.