-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.js
32 lines (28 loc) · 1.1 KB
/
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
26
27
28
29
30
31
32
// @ts-check
// eslint-disable-next-line @typescript-eslint/no-var-requires
const nextJest = require('next/jest')
// eslint-disable-next-line no-undef
const createJestConfig = nextJest({ dir: './' })
const customJestConfig = {
roots: ['<rootDir>'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'json', 'jsx'],
testPathIgnorePatterns: ['<rootDir>[/\\\\](node_modules|.next)[/\\\\]'],
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(ts|tsx)$'],
transform: {
'^.+\\.stories\\.tsx$': '@storybook/addon-storyshots/injectFileName',
'^.+\\.(js|ts|tsx)$': 'babel-jest',
},
testMatch: ['<rootDir>/**/?(*.)(spec|test).(ts|js)?(x)'],
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname',
],
moduleNameMapper: {
'\\.(styl|css|less|scss)$': '<rootDir>/test/__mocks__/styleMock.js',
'\\.(gif|ttf|eot|svg|png)$': '<rootDir>/test/__mocks__/fileMock.js',
},
moduleDirectories: ['node_modules', 'src'],
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
testEnvironment: 'jest-environment-jsdom',
}
module.exports = createJestConfig(customJestConfig)