2023-01-02 14:13:45 -05:00
|
|
|
const config = require('../../../jest/config');
|
|
|
|
|
|
|
|
module.exports = Object.assign({}, config, {
|
|
|
|
testEnvironment: 'jest-environment-jsdom-global',
|
|
|
|
transform: {
|
|
|
|
'^.+\\.(js|ts|tsx)$': 'babel-jest',
|
|
|
|
},
|
|
|
|
moduleFileExtensions: ['js', 'ts', 'tsx'],
|
|
|
|
testEnvironmentOptions: {
|
|
|
|
url: 'http://localhost:9000/',
|
|
|
|
},
|
|
|
|
rootDir: '..',
|
2023-04-17 17:52:45 -05:00
|
|
|
collectCoverage: true,
|
2023-10-07 09:23:04 -05:00
|
|
|
setupFilesAfterEnv: ['<rootDir>/jest/setup-env.ts'],
|
2023-01-02 14:13:45 -05:00
|
|
|
setupFiles: ['<rootDir>/jest/setup.ts'],
|
|
|
|
transformIgnorePatterns: ['<rootDir>/node_modules/(?!react-syntax-highlighter)'],
|
|
|
|
snapshotSerializers: ['@emotion/jest/serializer'],
|
2023-04-17 17:52:45 -05:00
|
|
|
collectCoverageFrom: [
|
|
|
|
'src/**/*.{ts,tsx}',
|
|
|
|
'!**/node_modules/**',
|
|
|
|
'!src/**/*.stories.{ts,tsx}',
|
|
|
|
'!src/types/**',
|
|
|
|
],
|
2023-01-08 05:27:37 -05:00
|
|
|
modulePathIgnorePatterns: ['<rootDir>/build/'],
|
2023-01-02 14:13:45 -05:00
|
|
|
moduleNameMapper: {
|
|
|
|
'\\.(s?css)$': '<rootDir>/jest/identity.js',
|
|
|
|
'\\.(png)$': '<rootDir>/jest/identity.js',
|
|
|
|
'\\.(svg)$': '<rootDir>/jest/unit/empty.ts',
|
|
|
|
'\\.(jpg)$': '<rootDir>/jest/unit/empty.ts',
|
|
|
|
'\\.(md)$': '<rootDir>/jest/unit/empty-string.ts',
|
|
|
|
'react-markdown': '<rootDir>/src/__mocks__/react-markdown.tsx',
|
|
|
|
'remark-*': '<rootDir>/src/__mocks__/remark-plugin.ts',
|
|
|
|
},
|
2023-04-17 17:52:45 -05:00
|
|
|
coverageReporters: ['text', 'html'],
|
2023-01-08 05:27:37 -05:00
|
|
|
coverageThreshold: {
|
|
|
|
global: {
|
2024-02-18 15:08:17 -05:00
|
|
|
branches: 70,
|
|
|
|
functions: 76,
|
|
|
|
lines: 80,
|
|
|
|
statements: 82,
|
2023-01-08 05:27:37 -05:00
|
|
|
},
|
|
|
|
},
|
2023-01-02 14:13:45 -05:00
|
|
|
});
|