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
2022-02-20 14:12:07 +08:00

29 lines
788 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',
},
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;