-
Notifications
You must be signed in to change notification settings - Fork 67
/
jest.config.ts
33 lines (28 loc) · 948 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
import type { Config } from '@jest/types'
import nextJest from 'next/jest'
const config: Config.InitialOptions = {
transform: {
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/file-transformer.js',
},
moduleDirectories: ['node_modules', '<rootDir>'],
testTimeout: 1000,
testEnvironment: 'jest-environment-jsdom',
setupFiles: ['jest-canvas-mock'],
setupFilesAfterEnv: ['<rootDir>/test-configs/setup.ts'],
collectCoverage: true,
testPathIgnorePatterns: ['lambdas'],
}
const createJestConfig = nextJest({
dir: './',
})
const finalConfig = async (): Promise<Config.InitialOptions> => {
const nextConfig: Config.InitialOptions = await createJestConfig(config)()
return {
...nextConfig,
transformIgnorePatterns: [
'/node_modules/(?!(@web3-onboard|nanoid|ramda|isows|uint8arrays|multiformats|@walletconnect)/)',
],
}
}
export default finalConfig