-
Notifications
You must be signed in to change notification settings - Fork 9
/
jest.config.js
31 lines (29 loc) · 977 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
29
30
31
// @ts-check
// https://jestjs.io/docs/configuration#defaults
/** @type {import('ts-jest').JestConfigWithTsJest} */
const config = {
rootDir: './',
modulePaths: ['<rootDir>/src'],
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
moduleNameMapper: {
'.*\\.(css|scss|sass)$': '<rootDir>internals/jest/mocks/cssModule.js',
'.*\\.(jpg|jpeg|png|gif|webp|svg)$': '<rootDir>internals/jest/mocks/image.js',
},
clearMocks: true,
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/(?!(cborg|@oasisprotocol)/)'],
testPathIgnorePatterns: ['/node_modules/', '/playwright/'],
}
module.exports = config