mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
5625b8838c
* chore(core,ui): coverage ignore src/__mocks__/ * chore(core): build excludes src/__mocks__/ * refactor(core): split mock.ts into __mocks__/*.ts
30 lines
847 B
TypeScript
30 lines
847 B
TypeScript
import type { Config } from '@jest/types';
|
|
|
|
const config: Config.InitialOptions = {
|
|
preset: 'ts-jest',
|
|
testEnvironment: 'jsdom',
|
|
transform: {
|
|
// Enable JS/JSX transformation
|
|
'\\.(ts|js)x?$': 'ts-jest',
|
|
'\\.(svg)$': 'jest-transform-stub',
|
|
},
|
|
transformIgnorePatterns: [
|
|
'[/\\\\]node_modules[/\\\\]((?!ky[/\\\\]).)+\\.(js|jsx|mjs|cjs|ts|tsx)$',
|
|
],
|
|
moduleNameMapper: {
|
|
// Map path alias in `tsconfig.json`
|
|
'@/(.*)': '<rootDir>/src/$1',
|
|
// Mock CSS Modules
|
|
'\\.module\\.(css|sass|scss)$': 'identity-obj-proxy',
|
|
},
|
|
setupFilesAfterEnv: ['<rootDir>/src/jest.setup.ts'],
|
|
coveragePathIgnorePatterns: ['/node_modules/', '/dist/', '/src/__mocks__/'],
|
|
coverageReporters: ['text-summary', 'lcov'],
|
|
globals: {
|
|
'ts-jest': {
|
|
tsconfig: './tsconfig.test.json',
|
|
},
|
|
},
|
|
};
|
|
|
|
export default config;
|