-
Notifications
You must be signed in to change notification settings - Fork 45
/
jest.config.js
47 lines (45 loc) · 1.43 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// @ts-check
// https://jestjs.io/docs/configuration#defaults
/** @type {import('ts-jest').JestConfigWithTsJest} */
const config = {
rootDir: './',
clearMocks: true,
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
moduleNameMapper: {
'.*\\.(css|scss|sass)$': '<rootDir>internals/jest/mocks/cssModule.js',
'.*\\.(jpg|jpeg|png|gif|webp|svg)$': '<rootDir>internals/jest/mocks/image.js',
},
modulePaths: ['<rootDir>/src'],
resetMocks: true,
setupFiles: ['react-app-polyfill/jsdom'],
setupFilesAfterEnv: ['<rootDir>/internals/jest/setupTests.ts'],
testEnvironment: 'jsdom',
transform: {
'^.+\\.(js|jsx|mjs|cjs|ts|tsx)$': [
'ts-jest',
{
// Disable typechecking to speedup tests. We have `yarn checkTs`.
isolatedModules: true,
},
],
},
transformIgnorePatterns: [
'/node_modules/(?!(@ledgerhq/hw-transport-webusb|cborg|grommet/es6|grommet-icons/es6)/)',
],
testMatch: [
'<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}',
'<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}',
'<rootDir>/extension/src/**/__tests__/**/*.{js,jsx,ts,tsx}',
'<rootDir>/extension/src/**/*.{spec,test}.{js,jsx,ts,tsx}',
],
collectCoverageFrom: [
'src/**/*.{js,jsx,ts,tsx}',
'!src/vendors/**/*',
'!src/**/*/*.d.ts',
'!src/**/*/Loadable.{js,jsx,ts,tsx}',
'!src/**/*/messages.ts',
'!src/**/*/types.ts',
'!src/index.tsx',
],
}
module.exports = config