-
Notifications
You must be signed in to change notification settings - Fork 19
[WTF-2485]: Remove enzyme from widget generator in preparation of React 19 #156
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
base: master
Are you sure you want to change the base?
Conversation
...mplates/pluggable/web/emptyTemplateTs/src/components/__tests__/HelloWorldSample.spec.tsx.ejs
Show resolved
Hide resolved
33ed431 to
eaab3ca
Compare
eaab3ca to
e413267
Compare
be91f9e to
ba40f08
Compare
ba40f08 to
5c6c594
Compare
...ator-widget/generators/app/templates/packages/__tests__/outputs/package_web.json-js-e2e.json
Show resolved
Hide resolved
...widget/generators/app/templates/packages/__tests__/outputs/package_web.json-js-unit-e2e.json
Show resolved
Hide resolved
3dc1e92 to
6ef55e0
Compare
| "test": "pluggable-widgets-tools test:unit:web --no-cache --ci && npm run test:e2e", | ||
| "test:unit": "pluggable-widgets-tools test:unit:web --coverage", | ||
| "test": "pluggable-widgets-tools test:unit:web && npm run test:e2e", | ||
| "test:unit": "pluggable-widgets-tools test:unit:web", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When running unit tests on a generated widget from the command line I get the following error:
AIL src/components/__tests__/HelloWorldSample.spec.tsx
● Test suite failed to run
Jest encountered an unexpected token
Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.
Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.
By default "node_modules" folder is ignored by transformers.
Here's what you can do:
• If you are trying to use ECMAScript Modules, see https://jestjs.io/docs/ecmascript-modules for how to enable it.
• If you are trying to use TypeScript, see https://jestjs.io/docs/getting-started#using-typescript
• To have some of your "node_modules" files transformed, you can specify a custom "transformIgnorePatterns" in your config.
• If you need a custom transformation specify a "transform" option in your config.
• If you simply want to mock your non-JS modules (e.g. binary assets) you can stub them out with the "moduleNameMapper" config option.
| "@babel/plugin-transform-class-properties": "^7.25.9", | ||
| "@babel/plugin-transform-private-methods": "^7.25.9", | ||
| "@babel/plugin-transform-react-jsx": "^7.25.9", | ||
| "@babel/preset-env": "^7.26.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we update versions on generator and pluggable widgets tools ?
Checklist
[XX-000]: description)? ✅This PR contains
What is the purpose of this PR?
This PR prepares the Yeoman widget generator for replacing the Enzyme for testing in favor of RTL, the React Testing Library.
Relevant changes
What should be covered while testing?
REMAINING:
npm installis run