shlink-web-client/jest.config.js

39 lines
1.2 KiB
JavaScript
Raw Normal View History

module.exports = {
coverageDirectory: '<rootDir>/coverage',
collectCoverageFrom: [
2021-09-19 11:57:36 +03:00
'src/**/*.{ts,tsx}',
'!src/*.{ts,tsx}',
2020-08-29 14:51:53 +03:00
'!src/reducers/index.ts',
'!src/**/provideServices.ts',
'!src/container/*.ts',
],
2021-09-19 11:31:53 +03:00
coverageThreshold: {
global: {
statements: 85,
branches: 80,
2021-09-19 11:31:53 +03:00
functions: 80,
lines: 85,
2021-09-19 11:31:53 +03:00
},
},
setupFiles: ['<rootDir>/config/jest/setupEnzyme.js'],
setupFilesAfterEnv: ['<rootDir>/config/jest/setupTests.ts'],
testMatch: ['<rootDir>/test/**/*.test.{ts,tsx}'],
2019-01-06 01:16:13 +03:00
testEnvironment: 'jsdom',
testURL: 'http://localhost',
transform: {
'^.+\\.(ts|tsx|js)$': '<rootDir>/node_modules/babel-jest',
'^(?!.*\\.(ts|tsx|js|json)$)': '<rootDir>/config/jest/fileTransform.js',
},
2019-01-06 01:16:13 +03:00
transformIgnorePatterns: [
'<rootDir>/.stryker-tmp',
'/node_modules\\/(?!react-leaflet)\.(js|jsx|ts|tsx)$',
'^.+\\.module\\.scss$',
2019-01-06 01:16:13 +03:00
],
moduleNameMapper: {
'^.+\\.module\\.scss$': 'identity-obj-proxy',
2022-03-07 18:27:25 +03:00
// Reactstrap module resolution does not work in jest for some reason. Manually mapping it solves the problem
'reactstrap': '<rootDir>/node_modules/reactstrap/dist/reactstrap.umd.js',
},
moduleFileExtensions: ['js', 'ts', 'tsx', 'json'],
};