forked from phork/phorkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
28 lines (27 loc) · 993 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
26
27
28
const { defaults } = require('jest-config');
module.exports = {
verbose: false,
testEnvironment: 'jest-environment-jsdom',
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.jsx?$': 'babel-jest',
},
transformIgnorePatterns: ['/node_modules/(?!lodash-es).+\\.js$'],
globals: {
'ts-jest': {
tsconfig: '<rootDir>/__tests__/tsconfig.json',
diagnostics: true,
},
},
moduleFileExtensions: [...defaults.moduleFileExtensions, 'ts', 'tsx'],
modulePathIgnorePatterns: [...defaults.modulePathIgnorePatterns, 'lib/package.json'],
testPathIgnorePatterns: [...defaults.testPathIgnorePatterns, '.d.ts$'],
testMatch: ['**/__tests__/**/*.(spec|test).[jt]s?(x)'],
moduleNameMapper: {
'^lib(.*)$': '<rootDir>/src$1',
'^__mocks__/(.*)$': '<rootDir>/__mocks__/$1',
'\\.css$': '<rootDir>/__mocks__/style.mock.js',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/__mocks__/file.mock.js',
},
};