mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-10-18 11:02:54 +00:00
- Add jest.config.js with Next.js integration, jsdom environment, module path mapping, and coverage collection for src/**/*.{js,jsx,ts,tsx}
- Add jest.setup.js with @testing-library/jest-dom, Next.js router/navigation mocks, IntersectionObserver/ResizeObserver/WebSocket/fetch mocks, localStorage/sessionStorage mocks
- Add package.json test scripts: test, test:watch, test:coverage
- Add testing dependencies: @testing-library/jest
21 lines
457 B
JavaScript
21 lines
457 B
JavaScript
const nextJest = require('next/jest.js')
|
|
|
|
const createJestConfig = nextJest({
|
|
dir: './',
|
|
})
|
|
|
|
/** @type {import('jest').Config} */
|
|
const customJestConfig = {
|
|
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
|
|
moduleNameMapper: {
|
|
'^@/(.*)$': '<rootDir>/src/$1',
|
|
},
|
|
testEnvironment: 'jest-environment-jsdom',
|
|
collectCoverageFrom: [
|
|
'src/**/*.{js,jsx,ts,tsx}',
|
|
'!src/**/*.d.ts',
|
|
],
|
|
}
|
|
|
|
module.exports = createJestConfig(customJestConfig)
|