-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.js
33 lines (33 loc) · 1.11 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
module.exports = {
roots: ['<rootDir>'],
moduleFileExtensions: ['js', 'ts', 'tsx', 'json'],
testMatch: ['**/__tests__/**/*.test.(ts|tsx|js)'],
testPathIgnorePatterns: ['<rootDir>[/\\\\](node_modules|.next)[/\\\\]'],
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(ts|tsx)$'],
transform: {
'^.+\\.(ts|tsx)$': 'babel-jest',
},
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname',
],
watchPathIgnorePatterns: ['.*/generated/'],
moduleNameMapper: {
'\\.(css|less|sass|scss)$': 'identity-obj-proxy',
'\\.(gif|ttf|eot|svg|png)$': '<rootDir>/__tests__/__mocks__/fileMock.js',
},
// Добавил <rootDir>/src/next/, чтобы резолвились пути к модулям
modulePaths: ['<rootDir>', '<rootDir>/src/next/'],
testURL: 'http://localhost:3000',
preset: 'ts-jest/presets/js-with-babel',
collectCoverageFrom: [
'./(src|dev)/**/*.{ts,tsx,js,jsx,d.ts,d.tsx}',
'!./dev/server/**',
'!**/node_modules/**',
'!**.next/**',
'!**/dist/**',
'!**/coverage/**',
'!**/storybook-static/**',
'!**/generated/**',
],
}