forked from loggi/desafio-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.config.js
25 lines (22 loc) · 872 Bytes
/
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
const nextJest = require('next/jest')
// Providing the path to your Next.js app which will enable loading next.config.js and .env files
const createJestConfig = nextJest({ dir: './' })
// Any custom config you want to pass to Jest
const customJestConfig = {
setupFilesAfterEnv: ['<rootDir>/.jest/setup.js'],
testEnvironment: 'jest-environment-jsdom',
collectCoverage: true,
collectCoverageFrom: [
'src/**/*.js(x)?',
'!src/**/mock.js',
'!src/app/**/*.js(x)?',
'!src/templates/**/*.js(x)?',
'!src/styles/**/*.js(x)?',
'!src/utils/**/*.js(x)?'
],
snapshotSerializers: [
'@emotion/jest/serializer' /* if needed other snapshotSerializers should go here */
]
}
// createJestConfig is exported in this way to ensure that next/jest can load the Next.js configuration, which is async
module.exports = createJestConfig(customJestConfig)