shlink-web-client/jest.config.js

42 lines
1.3 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',
2022-05-01 11:19:38 +03:00
testEnvironmentOptions: {
url: '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|react-leaflet|leaflet|react-chartjs-2)\/)',
'^.+\\.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',
'react-chartjs-2': '<rootDir>/node_modules/react-chartjs-2/dist/index.js',
},
moduleFileExtensions: ['js', 'ts', 'tsx', 'json'],
};