- Replace Jest with Bun's native testing framework - Update test configuration and utilities to support Bun test environment - Add mock implementations for SSE and security testing - Refactor test setup to use Bun's testing utilities - Update package dependencies and scripts to align with Bun testing - Enhance type definitions for Bun test mocking
37 lines
861 B
TypeScript
37 lines
861 B
TypeScript
import type { JestConfigWithTsJest } from 'ts-jest';
|
|
|
|
const config: JestConfigWithTsJest = {
|
|
preset: 'ts-jest',
|
|
testEnvironment: 'node',
|
|
extensionsToTreatAsEsm: ['.ts'],
|
|
moduleNameMapper: {
|
|
'^(\\.{1,2}/.*)\\.js$': '$1',
|
|
},
|
|
transform: {
|
|
'^.+\\.tsx?$': [
|
|
'ts-jest',
|
|
{
|
|
useESM: true,
|
|
tsconfig: 'tsconfig.json',
|
|
},
|
|
],
|
|
},
|
|
testMatch: ['**/__tests__/**/*.test.ts'],
|
|
verbose: true,
|
|
clearMocks: true,
|
|
resetMocks: true,
|
|
restoreMocks: true,
|
|
testTimeout: 30000,
|
|
maxWorkers: '50%',
|
|
collectCoverage: true,
|
|
coverageDirectory: 'coverage',
|
|
coverageReporters: ['text', 'lcov'],
|
|
globals: {
|
|
'ts-jest': {
|
|
useESM: true,
|
|
isolatedModules: true,
|
|
},
|
|
},
|
|
};
|
|
|
|
export default config;
|