0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-23 20:33:16 -05:00
logto/packages/ui/jest.config.ts

31 lines
828 B
TypeScript
Raw Normal View History

2022-02-19 02:14:23 -05:00
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',
2022-02-19 02:14:23 -05:00
},
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/'],
coverageReporters: ['text-summary', 'lcov'],
globals: {
'ts-jest': {
tsconfig: './tsconfig.test.json',
},
},
};
export default config;