Skip to content
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

Implement Code Coverage #15

Open
readysetagile opened this issue Aug 6, 2022 · 1 comment · Fixed by #62
Open

Implement Code Coverage #15

readysetagile opened this issue Aug 6, 2022 · 1 comment · Fixed by #62
Labels
CD/CD Related to Continuous Integration and continuous deployment Engineering Practices Issue is related to unit testing, coding standards, unit testing, etc.

Comments

@readysetagile
Copy link
Collaborator

readysetagile commented Aug 6, 2022

Attempt to implement Code coverage that is automatically run on CI builds

Acceptance Criteria

GIVEN I am a Free Code Camp developer
WHEN I run npm run test on the CLI
THEN the coverage folder will be created
AND all the unit tests will be run
AND I will see the code coverage report

Guidance

@readysetagile readysetagile moved this from Ready for refinement - write the acceptance criteria (test script) for the feature to Ready for development - feature has a GitHub issue assigned and can be developed in FreeCodeCamp Columbus Website Aug 6, 2022
@readysetagile readysetagile moved this from Ready for development - feature has a GitHub issue assigned and can be developed to In development - at least one person is developing this item in FreeCodeCamp Columbus Website Sep 29, 2022
@readysetagile readysetagile moved this from In development - at least one person is developing this item to Ready for development - feature has a GitHub issue assigned and can be developed in FreeCodeCamp Columbus Website Jun 21, 2023
@readysetagile
Copy link
Collaborator Author

readysetagile commented Aug 1, 2023

so simply changing the test line in the scripts section of the package.json file should be enough:

    "test": "react-scripts test --watchAll=false --coverage",

I would like to get our code coverage back in the 'green':

--
I was able to see a code coverage report from a windows command line.  

C:\repos\cbus-web>set CI=true && npm test -- --env=jsdom --coverage

> [email protected] test
> react-scripts test --coverage --env=jsdom --coverage

 PASS  src/test/components/Members.test.js
 PASS  src/test/components/Event.test.js
 PASS  src/test/components/Header.test.js
 PASS  src/test/components/Footer.test.js
 PASS  src/test/App.test.js
 PASS  src/test/components/Events.test.js
 PASS  src/test/components/Splash.test.js
 PASS  src/test/components/About.test.js
---------------------|---------|----------|---------|---------|-------------------
File                 | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
---------------------|---------|----------|---------|---------|-------------------
All files            |   60.71 |       50 |   85.71 |   60.71 |
 src                 |    8.33 |        0 |   33.33 |    8.33 |
  App.js             |     100 |      100 |     100 |     100 |
  index.js           |       0 |      100 |     100 |       0 | 7-17
  links.js           |       0 |        0 |       0 |       0 |
  reportWebVitals.js |       0 |        0 |       0 |       0 | 1-10
 src/components      |     100 |    83.33 |     100 |     100 |
  About.jsx          |     100 |      100 |     100 |     100 |
  Event.jsx          |     100 |      100 |     100 |     100 |
  Events.jsx         |     100 |      100 |     100 |     100 |
  Footer.jsx         |     100 |       75 |     100 |     100 | 15
  Header.jsx         |     100 |      100 |     100 |     100 |
  Members.jsx        |     100 |      100 |     100 |     100 |
  Splash.jsx         |     100 |      100 |     100 |     100 |
---------------------|---------|----------|---------|---------|-------------------

Test Suites: 8 passed, 8 total
Tests:       14 passed, 14 total
Snapshots:   8 passed, 8 total
Time:        6.048 s
Ran all test suites.

@mmcbride2929 mmcbride2929 moved this from Ready for development to Code Review in FreeCodeCamp Columbus Website Aug 14, 2023
@readysetagile readysetagile linked a pull request Aug 15, 2023 that will close this issue
@readysetagile readysetagile moved this from Code Review to Ready to be staged in FreeCodeCamp Columbus Website Aug 15, 2023
@readysetagile readysetagile moved this from Ready to be staged to Ready for Testing in FreeCodeCamp Columbus Website Aug 21, 2023
@mmcbride2929 mmcbride2929 moved this from Ready for Testing to Ready for Deployment in FreeCodeCamp Columbus Website Aug 28, 2023
@readysetagile readysetagile moved this from Ready for Deployment to Done! in FreeCodeCamp Columbus Website Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CD/CD Related to Continuous Integration and continuous deployment Engineering Practices Issue is related to unit testing, coding standards, unit testing, etc.
Projects
Development

Successfully merging a pull request may close this issue.

2 participants