[ ] Update the webpack config file to add the istanbul plugin on non-production environments (see CTS)
[ ] Remove the line that adds the instanbul plugin within the babel config file
[ ] Move the nyc config from package.json to nyc.config.json for visibility / consistency
[ ] Exclude the Create React App scaffolding files from code coverage collection
'src/serviceWorker.js','src/setupTests.js',
[ ] Update the lint scripts in package.json to includes the Cypress Javascript files in code standards checks
With the updated standards check, the workflow will fail unless the linting issues are addressed.
In a separate commit tagged to the same issue, address any linting issues with the linted Cypress Javascript.
Fixing the Cypress lint issues
First
[ ] Run npx eslint cypress --fix
(Note: Using npx here to side step a bug with eslint, our version of npm, and the '--fix' flag not executing the automatic fixes)
Issue description
This is basically https://github.com/NCIOCPL/cgov-react-app-playground/issues/38, but @cypress/code-coverage needs to be installed first. So install it, and follow the pattern in the playground.
We need to update the scripts and the overall process for combined code coverage to align with the approach in CTS.
The code coverage changes were made in #265 for
clinical-trials-search-app
.The following files in CTS have major diferences --use them as a reference:
Itemized changes
Mileage may vary per repository but for
cgov-react-app-playground
the following is required:[ ] Update the coverage collection key in
package.json
to specify the src directory and exclude test files:[ ] Update the webpack config file to add the istanbul plugin on non-production environments (see CTS)
[ ] Remove the line that adds the instanbul plugin within the babel config file
[ ] Exclude the Create React App scaffolding files from code coverage collection
'src/serviceWorker.js',
'src/setupTests.js',
[ ] Update the
lint
scripts inpackage.json
to includes the Cypress Javascript files in code standards checksWith the updated standards check, the workflow will fail unless the linting issues are addressed.
In a separate commit tagged to the same issue, address any linting issues with the linted Cypress Javascript.
Fixing the Cypress lint issues
First
npx eslint cypress --fix
(Note: Using npx here to side step a bug with eslint, our version of npm, and the '--fix' flag not executing the automatic fixes)
Then
Resources:
Notes