-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
29 lines (29 loc) · 1.05 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
module.exports = {
transform: {
'^.+\\.(js|jsx|mjs|ts|tsx)$': '<rootDir>/scripts/jest/babelTransform.js',
'^.+\\.css$': '<rootDir>/scripts/jest/cssTransform.js',
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)':
'<rootDir>/scripts/jest/fileTransform.js',
},
testMatch: [
'<rootDir>/packages/**/__tests__/**/*.{js,jsx,ts,tsx}',
'<rootDir>/packages/**/?(*.)(spec|test).{js,jsx,ts,tsx}',
],
moduleNameMapper: {
'\\.(css|less)$': '<rootDir>/scripts/jest/__mocks__/styleMock.js',
},
modulePathIgnorePatterns: ['dist/', 'build/', 'node_modules'],
collectCoverageFrom: ['<rootDir>/packages/**/src/**/*.{js,jsx,mjs,ts,tsx}'],
setupFilesAfterEnv: ['<rootDir>/scripts/jest/setupTests.js'],
testEnvironment: 'jsdom',
testEnvironmentOptions: { url: 'http://localhost' },
transformIgnorePatterns: [
'[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$',
'^.+\\.module\\.(css|sass|scss)$',
],
moduleDirectories: ['node_modules', 'src'],
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname',
],
};