New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@ui5/webcomponents-react: jest configuration to transpile ui5 web component code #150
Comments
Hi @shen-lin, I guess you need to transpile the node modules as well, you can take a look at our jest config. If that doesn't help, you can send me the repository link via mail or slack and I can try to figure out something. Best regards, |
Maybe we have to wait for jsdom/jsdom#2548 to be merged. |
Hi @shen-lin, short update to that topic: {
"jest": {
"transformIgnorePatterns": [
"node_modules/(?!(@ui5|lit-html)).*\\.js$"
]
}
} |
Hi @shen-lin, Best regards, |
Couldn't find story matching '1-welcome-test-setup--page'. |
Sorry, the links have been updated: https://sap.github.io/ui5-webcomponents-react/?path=/docs/knowledge-base--page |
Describe the issue
I have an ejected react app by using create-react-app. When I try to setup the unit test, I got error
TypeError: WebComponent.getMetadata is not a function
If I modified the code in node_modules/@UI5 like this:
Similarly, in node_modules/@ui5/webcomponents/webcomponents-react/cjs/main.development.js, I change boot().then(...) to boot.default().then(...). After these two changes, my unit test runs successfully.
I think my jest config is not correct so that I run into this problem that is related to:
https://stackoverflow.com/questions/33505992/babel-6-changes-how-it-exports-default
But I am not able to figure out the correct configuration to pass this error. Could you suggest how can I fix this issue?
To Reproduce
The github repository is in corporate github. I can send you the repository url by email.
The text was updated successfully, but these errors were encountered: