mirror of
https://github.com/johndoe6345789/snippet-pastebin.git
synced 2026-04-24 13:34:55 +00:00
- Install Jest, @testing-library/react, and related dependencies - Create jest.config.ts and jest.setup.ts configuration - Generate unit tests for all 141 React components (1 per component) - Tests cover UI components, app pages, features, and utilities - 232 tests currently passing with proper assertions - Add test scripts for running unit tests (npm test) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
27 lines
667 B
TypeScript
27 lines
667 B
TypeScript
import type { Config } from 'jest'
|
|
import nextJest from 'next/jest'
|
|
|
|
const createJestConfig = nextJest({
|
|
dir: './',
|
|
})
|
|
|
|
const config: Config = {
|
|
coverageProvider: 'v8',
|
|
testEnvironment: 'jsdom',
|
|
roots: ['<rootDir>/src'],
|
|
testMatch: ['**/__tests__/**/*.test.ts?(x)', '**/?(*.)+(spec|test).ts?(x)'],
|
|
moduleNameMapper: {
|
|
'^@/(.*)$': '<rootDir>/src/$1',
|
|
'^@styles/(.*)$': '<rootDir>/src/styles/$1',
|
|
},
|
|
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
|
|
collectCoverageFrom: [
|
|
'src/**/*.{js,jsx,ts,tsx}',
|
|
'!src/**/*.d.ts',
|
|
'!src/**/*.stories.{js,jsx,ts,tsx}',
|
|
'!src/**/__tests__/**',
|
|
],
|
|
}
|
|
|
|
export default createJestConfig(config)
|