-
Notifications
You must be signed in to change notification settings - Fork 98
/
jest.config.js
52 lines (52 loc) · 1.92 KB
/
jest.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
module.exports = {
projects: [
{
preset: 'ts-jest',
setupFilesAfterEnv: ['<rootDir>/jest/mocks/jest.setup.js'],
collectCoverageFrom: [
'packages/**/*.{js,jsx,ts,tsx}',
'!packages/**/*.d.ts',
],
testMatch: [
'<rootDir>/packages/components/ovh-shell/**/*.{spec,test}.{js,jsx,ts,tsx}',
'<rootDir>/packages/manager/apps/container/**/*.{spec,test}.{js,jsx,ts,tsx}',
'<rootDir>/packages/core/url-builder/**/*.{spec,test}.{js,jsx,ts,tsx}',
],
testEnvironment: 'jest-environment-jsdom',
transform: {
'^.+\\.(js|jsx|mjs|cjs|ts|tsx|scss)$':
'<rootDir>/node_modules/babel-jest',
'^.+\\.css$': '<rootDir>/jest/mocks/cssMock.js',
},
transformIgnorePatterns: [
'node_modules/(?!lodash-es|@ovhcloud|@stencil|@ovh-ux|uuid|jest-cucumber)',
'^.+\\.module\\.(css|sass|scss)$',
'<rootDir>/node_modules/(?!lodash-es|@stencil)',
],
testPathIgnorePatterns: ['/node_modules/'],
moduleNameMapper: {
'^.+\\.module\\.(css|sass|scss)$': 'identity-obj-proxy',
'.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$':
'<rootDir>/jest/mocks/images.tsx',
'^lodash-es$': 'lodash',
'@ovh-ux/manager-core-api':
'<rootDir>/packages/manager/core/api/src/index.ts',
'@ovh-ux/manager-react-shell-client':
'<rootDir>/packages/manager/core/shell-client/src/index.tsx',
'/axios/': 'axios/dist/node/axios.cjs',
uuid: require.resolve('uuid'),
nanoid: require.resolve('nanoid'),
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
resetMocks: true,
globals: {
'ts-jest': {
isolatedModules: true,
diagnostics: false,
},
},
moduleDirectories: ['node_modules'],
modulePathIgnorePatterns: ['/dist/', 'packages/manager/apps/container'],
},
],
};