2021-08-02 17:24:01 +05:30
|
|
|
/*
|
2022-12-27 12:37:58 +05:30
|
|
|
* Copyright 2022 Collate.
|
2021-12-01 12:46:28 +05:30
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
2021-08-02 17:24:01 +05:30
|
|
|
|
2021-08-01 14:27:44 -07:00
|
|
|
module.exports = {
|
|
|
|
// Project name
|
2021-08-16 18:29:24 +05:30
|
|
|
displayName: '@openmetadata',
|
2021-08-01 14:27:44 -07:00
|
|
|
|
2022-12-29 19:18:48 +05:30
|
|
|
globals: {
|
|
|
|
// TypeScript
|
|
|
|
'ts-jest': {
|
|
|
|
tsconfig: 'tsconfig.json',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2021-08-01 14:27:44 -07:00
|
|
|
// Working directory
|
|
|
|
roots: ['<rootDir>/src'],
|
|
|
|
|
|
|
|
// Test files
|
|
|
|
testMatch: ['<rootDir>/src/**/*.test.{ts,tsx,js,jsx}'], // All test files in subdirectories under /src
|
|
|
|
|
2022-01-31 22:09:00 +05:30
|
|
|
// Test coverage
|
2022-02-01 18:06:55 +05:30
|
|
|
coverageDirectory: '<rootDir>/src/test/unit/coverage',
|
2022-01-31 22:09:00 +05:30
|
|
|
collectCoverageFrom: [
|
2022-02-01 18:06:55 +05:30
|
|
|
'<rootDir>/src/**/*.{ts,tsx,js,jsx}', // All files in subdirectories under src/app
|
|
|
|
'!<rootDir>/src/*', // Exclude files directly under src/app
|
2022-01-31 22:09:00 +05:30
|
|
|
],
|
2023-01-06 10:14:29 +05:30
|
|
|
coveragePathIgnorePatterns: [
|
|
|
|
'<rootDir>/src/@types/*',
|
|
|
|
'<rootDir>/src/interface/*',
|
|
|
|
'<rootDir>/src/generated/*',
|
|
|
|
'<rootDir>/src/enums/*',
|
|
|
|
],
|
2021-08-01 14:27:44 -07:00
|
|
|
|
|
|
|
// Transforms
|
|
|
|
transform: {
|
|
|
|
'^.+\\.ts|tsx?$': 'ts-jest',
|
|
|
|
'^.+\\.js|jsx?$': '<rootDir>/node_modules/babel-jest',
|
|
|
|
},
|
|
|
|
|
2022-08-27 16:00:38 +05:30
|
|
|
setupFilesAfterEnv: ['./src/setupTests.js'],
|
2021-08-01 14:27:44 -07:00
|
|
|
clearMocks: true,
|
|
|
|
moduleNameMapper: {
|
|
|
|
'\\.svg': '<rootDir>/src/test/unit/mocks/svg.mock.js', // Mock SVG imports
|
|
|
|
'\\.(scss)$': 'identity-obj-proxy', // Mock style imports
|
|
|
|
'\\.(jpg|JPG|gif|GIF|png|PNG|less|LESS|css|CSS)$':
|
|
|
|
'<rootDir>/src/test/unit/mocks/file.mock.js',
|
2022-05-02 10:36:30 +05:30
|
|
|
'\\.json': '<rootDir>/src/test/unit/mocks/json.mock.js',
|
2022-06-14 02:08:54 +05:30
|
|
|
'@github/g-emoji-element': '<rootDir>/src/test/unit/mocks/gemoji.mock.js',
|
2024-03-06 17:33:13 +05:30
|
|
|
'quilljs-markdown': '<rootDir>/src/test/unit/mocks/gemoji.mock.js',
|
2024-03-12 18:46:24 +05:30
|
|
|
'@azure/msal-browser':
|
|
|
|
'<rootDir>/node_modules/@azure/msal-browser/lib/msal-browser.cjs',
|
|
|
|
'@azure/msal-react':
|
|
|
|
'<rootDir>/node_modules/@azure/msal-react/dist/index.js',
|
2023-12-05 12:31:13 +05:30
|
|
|
axios: 'axios/dist/node/axios.cjs',
|
2024-09-06 19:23:13 +05:30
|
|
|
'react-antd-column-resize':
|
|
|
|
'<rootDir>/src/test/unit/mocks/reactColumnResize.mock.js',
|
2021-08-01 14:27:44 -07:00
|
|
|
},
|
2024-03-12 18:46:24 +05:30
|
|
|
transformIgnorePatterns: ['node_modules/(?!@azure/msal-react)'],
|
2022-04-01 10:31:45 +05:30
|
|
|
|
2022-12-29 19:18:48 +05:30
|
|
|
// TypeScript
|
|
|
|
preset: 'ts-jest',
|
|
|
|
|
|
|
|
// Test Environment
|
|
|
|
testEnvironment: 'jsdom',
|
|
|
|
|
2022-04-01 10:31:45 +05:30
|
|
|
// Sonar Cloud Configuration
|
|
|
|
testResultsProcessor: 'jest-sonar-reporter',
|
2022-07-28 21:19:22 -07:00
|
|
|
|
|
|
|
// use fake timers
|
|
|
|
timers: 'fake',
|
2023-01-10 20:04:51 +05:30
|
|
|
|
|
|
|
moduleDirectories: ['node_modules', 'src'],
|
2021-08-01 14:27:44 -07:00
|
|
|
};
|