feature/ga
parent
3874be66b0
commit
9d0579a662
@ -1,20 +1,13 @@
|
|||||||
module.exports = {
|
const nextJest = require('next/jest')
|
||||||
collectCoverageFrom: [
|
|
||||||
'**/*.{js,jsx,ts,tsx}',
|
const createJestConfig = nextJest({
|
||||||
'!**/*.d.ts',
|
dir: './',
|
||||||
'!**/node_modules/**',
|
})
|
||||||
],
|
|
||||||
setupFilesAfterEnv: ['<rootDir>/setupTests.js'],
|
const customJestConfig = {
|
||||||
testPathIgnorePatterns: ['/node_modules/', '/.next/'],
|
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
|
||||||
transform: {
|
moduleDirectories: ['node_modules', '<rootDir>/'],
|
||||||
'^.+\\.(js|jsx|ts|tsx)$': '<rootDir>/node_modules/babel-jest',
|
testEnvironment: 'jest-environment-jsdom',
|
||||||
'^.+\\.css$': '<rootDir>/config/jest/cssTransform.js',
|
}
|
||||||
},
|
|
||||||
transformIgnorePatterns: [
|
module.exports = createJestConfig(customJestConfig)
|
||||||
'/node_modules/',
|
|
||||||
'^.+\\.module\\.(css|sass|scss)$',
|
|
||||||
],
|
|
||||||
moduleNameMapper: {
|
|
||||||
'^.+\\.module\\.(css|sass|scss)$': 'identity-obj-proxy',
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
// Optional: configure or set up a testing framework before each test.
|
||||||
|
// If you delete this file, remove `setupFilesAfterEnv` from `jest.config.js`
|
||||||
|
|
||||||
|
// Used for __tests__/testing-library.js
|
||||||
|
// Learn more: https://github.com/testing-library/jest-dom
|
||||||
|
import '@testing-library/jest-dom/extend-expect'
|
||||||
@ -1,5 +0,0 @@
|
|||||||
// jest.setup.ts
|
|
||||||
import '@testing-library/jest-dom';
|
|
||||||
|
|
||||||
|
|
||||||
configure({ adapter: new ReactAdapter() });
|
|
||||||
Loading…
Reference in new issue