forked from instantcommerce/next-password-protect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest.config.ts
29 lines (28 loc) · 856 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
29
import type { Config } from '@jest/types';
export default {
testEnvironment: 'jsdom',
testEnvironmentOptions: {
url: 'https://jestjs.io',
},
roots: ['<rootDir>/src'],
transform: {
'^.+\\.tsx?$': 'babel-jest',
},
moduleNameMapper: {
'^~(.*)$': '<rootDir>/src/$1',
'^~test-utils(.*)$': '<rootDir>/src/lib/test-utils$1',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/src/components/common/Icon/__mocks__/req',
'\\.(css|less)$': '<rootDir>/__mocks__/styleMock.ts',
},
moduleDirectories: [
'node_modules',
'src/lib', // a utility folder
__dirname, // the root directory
],
setupFilesAfterEnv: [
'@testing-library/jest-dom/extend-expect',
'./jest.setup.js',
],
collectCoverageFrom: ['src/**/*.{ts,tsx}'],
} as Config.InitialOptions;