-
Notifications
You must be signed in to change notification settings - Fork 425
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
Support for Cypress Code Coverage Tool when using react-app-rewired #461
Comments
Do you know where the docs are for -r (what does it do)? I would suggest maybe digging around here to see if the value is coming in https://github.com/timarney/react-app-rewired/blob/master/bin/index.js#L3 |
The -r is actually a node.js command line option to register a compiler/transformer for certain file types when it runs the original script. It's handled by node.js itself prior to calling react-scripts or react-app-rewired. I've followed the instructions from the link provided to create an example CRA project with typescript, then added react-app-rewired to the project. The basic react welcome page is created with the expected What I have not tested is adding AntD to the example project as well, because I'm not familiar with how to do so. Are you able to share an example repository that matches the setup you have so I can debug further? There's also another possibility to consider: Jest is also able to produce code coverage reports, including the same html reports on covered/uncovered lines, etc. This is done in |
Thanks for your input. Changes needed
2nd workaround - following ant-design/babel-plugin-import#204
For both, instrument the app either using
I use the addBabelPlugin method and it indeed worked. Not sure though why we need to use require or import as ant/lib when import as 'ant' was working just fine and so was seeking to get that answer. |
|
We are trying to integrate Cypress Code Coverage from this link in our project.
Our app was built using
Our current start script looks like
"start": "PORT=7000 react-app-rewired start"
and as recommend in the link we install the dependencies and try and change the script to
"start": "PORT=7000 react-app-rewired -r @cypress/instrument-cra start"
it won't workWe tried
"start": "PORT=7000 react-scripts -r @cypress/instrument-cra start"
but it obviously won't work.Does
react-app-rewired
support the -r command ?How can we make this work?
The text was updated successfully, but these errors were encountered: