-
-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathjest.config.js
31 lines (28 loc) · 1.06 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
// eslint-disable-next-line @typescript-eslint/no-var-requires
const nextJest = require('next/jest');
const createJestConfig = nextJest({
dir: './',
});
/** @type {import('jest').Config} */
const customJestConfig = {
moduleNameMapper: {
/* Handle libraries */
'^lib/supabase$': '<rootDir>/__mocks__/supabase.ts',
'^d3-force$': '<rootDir>/__mocks__/d3-force.ts',
'^d3-drag$': '<rootDir>/__mocks__/d3-drag.ts',
'^d3-zoom$': '<rootDir>/__mocks__/d3-zoom.ts',
'^d3-selection$': '<rootDir>/__mocks__/d3-selection.ts',
'^unified$': '<rootDir>/__mocks__/unified.ts',
'^remark-parse$': '<rootDir>/__mocks__/remark-parse.ts',
'^remark-gfm$': '<rootDir>/__mocks__/remark-gfm.ts',
'^next/router$': '<rootDir>/__mocks__/next-router.ts',
},
testPathIgnorePatterns: [
'<rootDir>/cypress/',
'<rootDir>/__tests__/.eslintrc.js',
],
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
moduleDirectories: ['node_modules', '<rootDir>/'],
testEnvironment: 'jest-environment-jsdom',
};
module.exports = createJestConfig(customJestConfig);