Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

114 lines
3.6 KiB
JavaScript
Raw Normal View History

/*
* Copyright 2022 Collate.
* 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-01 14:27:44 -07:00
module.exports = {
// Project name
displayName: '@openmetadata',
2021-08-01 14:27:44 -07:00
// Performance optimizations
maxWorkers: '50%', // Use half of available CPU cores
cache: true,
cacheDirectory: './node_modules/.cache/jest',
// Removed globals for Jest 29+ compatibility
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
// Test coverage
coverageDirectory: '<rootDir>/src/test/unit/coverage',
collectCoverageFrom: [
'<rootDir>/src/**/*.{ts,tsx,js,jsx}', // All files in subdirectories under src/app
'!<rootDir>/src/*', // Exclude files directly under src/app
],
coveragePathIgnorePatterns: [
'<rootDir>/src/@types/*',
'<rootDir>/src/interface/*',
'<rootDir>/src/generated/*',
'<rootDir>/src/enums/*',
],
2021-08-01 14:27:44 -07:00
// Transforms for Jest 29+
2021-08-01 14:27:44 -07:00
transform: {
'^.+\\.(ts|tsx)$': [
'ts-jest',
{
tsconfig: 'tsconfig.json',
useESM: true,
},
],
'^.+\\.(js|jsx)$': 'babel-jest',
2021-08-01 14:27:44 -07:00
},
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',
'\\.json': '<rootDir>/src/test/unit/mocks/json.mock.js',
'@github/g-emoji-element': '<rootDir>/src/test/unit/mocks/gemoji.mock.js',
'quilljs-markdown': '<rootDir>/src/test/unit/mocks/gemoji.mock.js',
'@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',
'^axios$': '<rootDir>/node_modules/axios/dist/node/axios.cjs',
Feat(ui): Bump react, react-dom, react-router and dependant (#20869) * Feat(ui): Bump react, react-dom, react-router antd and dependant * update imports * fix more imports * update useParams * fix imports * fix compilation errors * bump react-oidc * Revert antd version bump * added missing css for antd v4 * fix merge issues * bump react-awesome-query-builder/antd * fix basepath error * clean errors and update withPageLayout HOC * fix test failure * fix the file error * fix some unit test * fix some unit test file * fix some unit test file * address comments * fix remaning utils test * fix some component folder test * fix page tests * fix tests for remaining pages * fix some more test * revert react-oidc upgrade * fix tests for pages * fix and skip some unit test * fix nested routes structure * Fix the type error for WebAnalyticsProvider * fix console errors * Revert "Fix the type error for WebAnalyticsProvider" This reverts commit e9780bf174a3f831480324260a10990e03cfe2b5. * fix the test and console error * fix the last failing unit test * fix dataInsight left panel tab switch * revert order of data assets for explore page * fix the schema editor, showing 2 sql editor * fix customProperty and glossary version page breaking and playwright test * Fix the advanced search playwright * fix bulk edit and glossary import page * fix bulk import page not working * Fix the advanced search styling * fix the unit test * fix multiple failing playwright test * fix sonar issue * fix kpi and alerts playwright issue * fix explore tree and sonar issue * fix customProperty playwright test * fix the console error * fix the failing page and test due to schema editor component failure * fix import not added * fix custom property and testsuite failing test * update yarn.lock * Fix CI error * Fix the sonarcloud check * Fix the Custom property format mapping for date time formats * Fix alert details page stuck in loading state * re-added the react-strict mode * fix custom property advance search * fix sonar, url encoding issue causing playwright test failure * fix the unit test and change data insight page render method * fix sonar and test suite playwright test * fix the sonar issue * fix the dataAssetHeader failing unit test * fix the explore tree issue on dev mode * update es format function for query builder * fix the failing unit test * fix sonar failure * changes around queryBuildr checkTree as it was deprecated * linter header added * fix the rule operator not resetting on rule field change * reverted back to checkTree as it query builder to not load inital options * fix advance search customproperty spec * Push the fix for failing playwright tests * trying to fix schema search * add wait for search service * Fix unit tests --------- Co-authored-by: Ashish Gupta <ashish@getcollate.io> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pranita <pfulsundar8@gmail.com> Co-authored-by: karanh37 <karanh37@gmail.com>
2025-06-29 16:25:51 +05:30
'@melloware/react-logviewer':
'<rootDir>/node_modules/@melloware/react-logviewer/dist/cjs/index.js',
'react-antd-column-resize':
'<rootDir>/src/test/unit/mocks/reactColumnResize.mock.js',
2021-08-01 14:27:44 -07:00
},
Feat(ui): Bump react, react-dom, react-router and dependant (#20869) * Feat(ui): Bump react, react-dom, react-router antd and dependant * update imports * fix more imports * update useParams * fix imports * fix compilation errors * bump react-oidc * Revert antd version bump * added missing css for antd v4 * fix merge issues * bump react-awesome-query-builder/antd * fix basepath error * clean errors and update withPageLayout HOC * fix test failure * fix the file error * fix some unit test * fix some unit test file * fix some unit test file * address comments * fix remaning utils test * fix some component folder test * fix page tests * fix tests for remaining pages * fix some more test * revert react-oidc upgrade * fix tests for pages * fix and skip some unit test * fix nested routes structure * Fix the type error for WebAnalyticsProvider * fix console errors * Revert "Fix the type error for WebAnalyticsProvider" This reverts commit e9780bf174a3f831480324260a10990e03cfe2b5. * fix the test and console error * fix the last failing unit test * fix dataInsight left panel tab switch * revert order of data assets for explore page * fix the schema editor, showing 2 sql editor * fix customProperty and glossary version page breaking and playwright test * Fix the advanced search playwright * fix bulk edit and glossary import page * fix bulk import page not working * Fix the advanced search styling * fix the unit test * fix multiple failing playwright test * fix sonar issue * fix kpi and alerts playwright issue * fix explore tree and sonar issue * fix customProperty playwright test * fix the console error * fix the failing page and test due to schema editor component failure * fix import not added * fix custom property and testsuite failing test * update yarn.lock * Fix CI error * Fix the sonarcloud check * Fix the Custom property format mapping for date time formats * Fix alert details page stuck in loading state * re-added the react-strict mode * fix custom property advance search * fix sonar, url encoding issue causing playwright test failure * fix the unit test and change data insight page render method * fix sonar and test suite playwright test * fix the sonar issue * fix the dataAssetHeader failing unit test * fix the explore tree issue on dev mode * update es format function for query builder * fix the failing unit test * fix sonar failure * changes around queryBuildr checkTree as it was deprecated * linter header added * fix the rule operator not resetting on rule field change * reverted back to checkTree as it query builder to not load inital options * fix advance search customproperty spec * Push the fix for failing playwright tests * trying to fix schema search * add wait for search service * Fix unit tests --------- Co-authored-by: Ashish Gupta <ashish@getcollate.io> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pranita <pfulsundar8@gmail.com> Co-authored-by: karanh37 <karanh37@gmail.com>
2025-06-29 16:25:51 +05:30
transformIgnorePatterns: [
'node_modules/(?!(@azure/msal-react|react-dnd|react-dnd-html5-backend|dnd-core|@react-dnd/invariant|@react-dnd/asap|@react-dnd/shallowequal|@melloware/react-logviewer|@material/material-color-utilities|@openmetadata/ui-core-components|nanoid|@rjsf/core|@rjsf/utils|@rjsf/validator-ajv8|uuid|elkjs))',
Feat(ui): Bump react, react-dom, react-router and dependant (#20869) * Feat(ui): Bump react, react-dom, react-router antd and dependant * update imports * fix more imports * update useParams * fix imports * fix compilation errors * bump react-oidc * Revert antd version bump * added missing css for antd v4 * fix merge issues * bump react-awesome-query-builder/antd * fix basepath error * clean errors and update withPageLayout HOC * fix test failure * fix the file error * fix some unit test * fix some unit test file * fix some unit test file * address comments * fix remaning utils test * fix some component folder test * fix page tests * fix tests for remaining pages * fix some more test * revert react-oidc upgrade * fix tests for pages * fix and skip some unit test * fix nested routes structure * Fix the type error for WebAnalyticsProvider * fix console errors * Revert "Fix the type error for WebAnalyticsProvider" This reverts commit e9780bf174a3f831480324260a10990e03cfe2b5. * fix the test and console error * fix the last failing unit test * fix dataInsight left panel tab switch * revert order of data assets for explore page * fix the schema editor, showing 2 sql editor * fix customProperty and glossary version page breaking and playwright test * Fix the advanced search playwright * fix bulk edit and glossary import page * fix bulk import page not working * Fix the advanced search styling * fix the unit test * fix multiple failing playwright test * fix sonar issue * fix kpi and alerts playwright issue * fix explore tree and sonar issue * fix customProperty playwright test * fix the console error * fix the failing page and test due to schema editor component failure * fix import not added * fix custom property and testsuite failing test * update yarn.lock * Fix CI error * Fix the sonarcloud check * Fix the Custom property format mapping for date time formats * Fix alert details page stuck in loading state * re-added the react-strict mode * fix custom property advance search * fix sonar, url encoding issue causing playwright test failure * fix the unit test and change data insight page render method * fix sonar and test suite playwright test * fix the sonar issue * fix the dataAssetHeader failing unit test * fix the explore tree issue on dev mode * update es format function for query builder * fix the failing unit test * fix sonar failure * changes around queryBuildr checkTree as it was deprecated * linter header added * fix the rule operator not resetting on rule field change * reverted back to checkTree as it query builder to not load inital options * fix advance search customproperty spec * Push the fix for failing playwright tests * trying to fix schema search * add wait for search service * Fix unit tests --------- Co-authored-by: Ashish Gupta <ashish@getcollate.io> Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com> Co-authored-by: Pranita <pfulsundar8@gmail.com> Co-authored-by: karanh37 <karanh37@gmail.com>
2025-06-29 16:25:51 +05:30
],
// TypeScript
preset: 'ts-jest',
// ESM support
extensionsToTreatAsEsm: ['.ts', '.tsx'],
// Test Environment
testEnvironment: 'jsdom',
// Sonar Cloud Configuration
testResultsProcessor: 'jest-sonar-reporter',
// use fake timers
fakeTimers: {
enableGlobally: true,
},
moduleDirectories: ['node_modules', 'src'],
reporters: [
'default',
[
'jest-junit',
{
outputDirectory: '../../../../target/test-reports',
outputName: 'jest-junit.xml',
classNameTemplate: '{classname}',
titleTemplate: '{title}',
ancestorSeparator: ' ',
usePathForSuiteName: 'true',
},
],
],
2021-08-01 14:27:44 -07:00
};