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

chore: code coverage #1207

Merged
merged 21 commits into from
Sep 26, 2024
Merged

chore: code coverage #1207

merged 21 commits into from
Sep 26, 2024

Conversation

radupasparuga
Copy link
Collaborator

@radupasparuga radupasparuga commented Aug 11, 2024

Implemented changes

This PR adds code coverage to our cypress tests using Istanbul (https://github.com/ifaxity/vite-plugin-istanbul)

TODO:

  • add code coverage to component tests

How to use:

  • npm run test:component (this will generate a coverage and a .nyc_output folder that contain info about our code coverage

  • npm run nyc:report to show a summary of code coverage
    Screenshot 2024-09-22 at 14 04 33

  • opening coverage/lcov-report/index.html opens a nice interface where we can view coverage information for each file
    Screenshot 2024-09-22 at 14 03 33

  • coverage is also added as a step in our run-tests pipeline (https://github.com/EOX-A/EOxElements/actions/runs/10873667192/job/30170032260?pr=1207), the "Code coverage" step displays the output of the npm run nyc:report command and the "Upload code coverage" step uploads the coverage/lcov-report folder as an artifact
    Screenshot 2024-09-22 at 14 10 20

Closes #638

Screenshots/Videos

Checklist before requesting a review

Copy link

netlify bot commented Aug 11, 2024

Deploy Preview for eoxelements ready!

Name Link
🔨 Latest commit 2a0df6a
🔍 Latest deploy log https://app.netlify.com/sites/eoxelements/deploys/66f3e7cf694cca000808a6cd
😎 Deploy Preview https://deploy-preview-1207--eoxelements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@radupasparuga radupasparuga marked this pull request as ready for review September 25, 2024 10:46
@silvester-pari silvester-pari self-requested a review September 26, 2024 14:38
Copy link
Collaborator

@silvester-pari silvester-pari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this deep-dive! It was quite tricky, but I think this is now a great addition to our toolset. Now the only thing left to do is writing more tests 😝

@silvester-pari silvester-pari merged commit 199cf17 into main Sep 26, 2024
7 checks passed
@silvester-pari silvester-pari deleted the elements/feat/code-coverage branch September 26, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add code coverage checks for tests
2 participants