-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjest.config.ts
28 lines (27 loc) · 1017 Bytes
/
jest.config.ts
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
/**
* Based on https://github.com/vercel/next.js/issues/8663#issuecomment-802289395
*
* @type {import('ts-jest/dist/types').InitialOptionsTsJest}
* */
const config = {
roots: ['<rootDir>'],
preset: 'ts-jest',
testEnvironment: 'jsdom',
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
moduleDirectories: ['node_modules', '<rootDir>/node_modules', '.'],
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json'],
testPathIgnorePatterns: ['<rootDir>[/\\\\](node_modules|.next|out|extension|cypress)[/\\\\]'],
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(ts|tsx)$'],
collectCoverageFrom: ['**/*.{ts,tsx}', '!**/*.d.ts', '!**/node_modules/**'],
// watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'],
moduleNameMapper: {
'\\.(css|scss)$': ['identity-obj-proxy'],
'\\.(jpg|jpeg|png|gif|svg)$': ['<rootDir>/tests/__mocks__/fileMock.js'],
},
globals: {
'ts-jest': {
tsconfig: 'tsconfig.test.json',
},
},
}
export default config