-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest.config.mjs
32 lines (30 loc) · 997 Bytes
/
jest.config.mjs
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
import nextJest from 'next/jest.js';
const createJestConfig = nextJest({
dir: './',
});
/** @type {import('jest').Config} */
const config = {
testEnvironment: 'jest-environment-jsdom',
collectCoverage: true,
collectCoverageFrom: [
"./components/**/*.{ts,tsx}",
"./pages/**/*.{ts,tsx}",
"./shared/hooks/*.ts",
"!**/*.d.ts",
"!**/node_modules/**",
],
coverageDirectory: './coverage',
testPathIgnorePatterns: [
"__tests__/utils.tsx",
],
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
setupFiles: ['<rootDir>/jest.polyfills.js', "jest-canvas-mock"],
moduleNameMapper: {
'^@/components/(.*)$': '<rootDir>/components/$1',
'^@/pages/(.*)$': '<rootDir>/pages/$1',
'^@/utils/(.*)$': '<rootDir>/utils/$1',
'^d3$': '<rootDir>/node_modules/d3/dist/d3.min.js',
'^d3-color$': '<rootDir>/node_modules/d3-color/dist/d3-color.js',
}
}
export default createJestConfig(config)