shlink-web-client/jest.config.js

52 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: 75,
2021-09-19 11:31:53 +03:00
functions: 80,
lines: 85,
2021-09-19 11:31:53 +03:00
},
},
2019-01-06 01:16:13 +03:00
resolver: 'jest-pnp-resolver',
setupFiles: [
2019-01-06 01:16:13 +03:00
'react-app-polyfill/jsdom',
'<rootDir>/config/setupEnzyme.js',
],
2019-01-06 01:16:13 +03:00
testMatch: [ '<rootDir>/test/**/*.test.{js,jsx,ts,tsx}' ],
testEnvironment: 'jsdom',
testURL: 'http://localhost',
transform: {
'^.+\\.(ts|tsx|js|jsx|mjs)$': '<rootDir>/node_modules/babel-jest',
'^.+\\.css$': '<rootDir>/config/jest/cssTransform.js',
'^(?!.*\\.(ts|tsx|js|jsx|mjs|css|json)$)': '<rootDir>/config/jest/fileTransform.js',
},
2019-01-06 01:16:13 +03:00
transformIgnorePatterns: [
'[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$',
'^.+\\.module\\.(css|sass|scss)$',
],
moduleNameMapper: {
'^react-native$': 'react-native-web',
2019-01-06 01:16:13 +03:00
'^.+\\.module\\.(css|sass|scss)$': 'identity-obj-proxy',
},
moduleFileExtensions: [
'web.js',
'js',
2019-01-06 01:16:13 +03:00
'web.ts',
'ts',
'web.tsx',
'tsx',
'json',
'web.jsx',
'jsx',
'node',
],
};