-
Notifications
You must be signed in to change notification settings - Fork 103
Description
Bug Description
Hi Team,
I am having an issue in running the test cases.
I am using "jest": "29.5.0"
My jest config in package.json is
"jest": {
"transformIgnorePatterns": [
"node_modules/*\\.js$"
],
"moduleNameMapper": {
"ace-builds": "<rootDir>/node_modules/ace-builds",
"^@ui5/webcomponents-base/jsx-runtime$": "<rootDir>/node_modules/@ui5/webcomponents-base/dist/jsx-runtime.js",
"^@ui5/webcomponents-base/Keys.js$": "<rootDir>/node_modules/@ui5/webcomponents-base/dist/Keys.js"
},
"coverageReporters": [
"json",
"html",
"lcov",
"text"
]
},
My jest.config.js configuration is,
module.exports = {
roots: ['./src'],
transform: {
'^.+\\.tsx?$': 'ts-jest',
'^.+\\.jsx?$': 'babel-jest'
},
testRegex: '(/tests/.*|(\\.|/)(test|spec))\\.tsx?$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
testPathIgnorePatterns: ['/node_modules/', '/public/'],
moduleNameMapper: {
'[\\.(css|less|scss|sss|styl)$](file://.(css|less|scss|sss|styl)$)': '<rootDir>/node_modules/jest-css-modules'
},
globals: {
'ts-jest': {
tsconfig: 'tsconfig.json'
}
},
testEnvironment: 'jsdom',
verbose: true,
setupFiles: ['<rootDir>/enzyme.config.js'],
preset: 'ts-jest/presets/js-with-ts'
}
When I have added shim import in App.tsx:
import '@ui5/webcomponents-base/dist/ssr-dom-shim.js';
I am getting the following test failures along with frontend issues like ui5-dialog not opening, Analytical table not rendering properly, etc.
Test Error
TypeError: Cannot destructure property 'labels' of 'internals' as it is undefined.
When I have not added the above shim import in App.tsx, my frontend issues automatically resolve, but still getting the following error on running the test case
TypeError: Cannot destructure property 'labels' of 'internals' as it is undefined.
When I remove the shim import setupTest.js, I am getting the following error for all test cases:
Currently, I am not facing any UI issues. I have only been facing problems in running my test cases.
Please help us to resolve the issue because we have been stuck in this for quite a long time. We need to upgrade it on high priority.
Affected Component
No response
Expected Behaviour
No response
Isolated Example
No response
Steps to Reproduce
- npm run test
Log Output, Stack Trace or Screenshots
No response
Priority
None
UI5 Web Components Version
2.8.0
Browser
Chrome
Operating System
Windows 11
Additional Context
No response
Organization
SAP Labs India
Declaration
- I’m not disclosing any internal or sensitive information.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status