-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
25 lines (25 loc) · 888 Bytes
/
jest.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
module.exports = {
testEnvironment: 'jsdom',
testPathIgnorePatterns: ['/node_modules/', '/.next/'],
collectCoverage: true,
collectCoverageFrom: [
'src/**/*.ts(x)?',
'!src/app/**', // should be tested in e2e
'!src/lib/registry.tsx',
'!src/types/**',
'!src/**/stories.tsx',
'!src/styles/**'
],
setupFilesAfterEnv: ['<rootDir>/.jest/setup.ts'],
modulePaths: ['<rootDir>/src/'],
transform: {
'^.+\\.(js|jsx|ts|tsx)$': ['babel-jest', { presets: ['next/babel'] }]
},
// https://github.com/styled-components/styled-components/issues/4081
// v6 of styled-components doesn't inject styles in test environment
// we should to force it to use the browser version
moduleNameMapper: {
'^styled-components':
'styled-components/dist/styled-components.browser.cjs.js'
}
}