-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathjest.config.ts
40 lines (36 loc) · 1014 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
30
31
32
33
34
35
36
37
38
39
40
import type { Config } from '@jest/types'
import nextJest from 'next/jest'
const babelConfigEmotion = {
presets: [
[
'next/babel',
{
'preset-react': {
runtime: 'automatic',
importSource: '@emotion/react',
},
},
],
],
plugins: [
require.resolve('@emotion/babel-plugin'),
require.resolve('babel-plugin-twin'),
require.resolve('babel-plugin-macros'),
],
}
const customJestConfig: Config.InitialOptions = {
verbose: true,
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
testEnvironment: 'jest-environment-jsdom',
modulePathIgnorePatterns: ['<rootDir>/dist/'],
testPathIgnorePatterns: ['<rootDir>/e2e'],
snapshotSerializers: ['@emotion/jest/serializer'],
moduleNameMapper: {
'@vercel/analytics': 'identity-obj-proxy',
},
transform: {
'^.+\\.(js|jsx|ts|tsx|mjs)$': ['babel-jest', babelConfigEmotion],
},
}
const createJestConfig = nextJest({ dir: './' })(customJestConfig)
export default createJestConfig