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

Improve focus of test coverage reporting #291

Merged
merged 34 commits into from
Mar 14, 2024
Merged

Conversation

meissadia
Copy link
Contributor

@meissadia meissadia commented Jan 26, 2024

Note: This PR builds upon #206, so will wait until those changes are merged before moving forward with revew.

Closes #290

Tests that imported components from the main DSR export (src/index.ts) caused the coverage report to include info on all of the components in DSR.

This PR imports components directly from their implementation files, allowing devs to focus on the test coverage of only the elements involved in the tests being run.

Changes

  • Adds some tests to improve test coverage
  • Imports components directly from their implementation files in:
    • Alert
    • Grid
    • Heading
    • Hero
    • useIconSvg
    • LabelLink
    • Pagination
    • Table
    • TextInput
    • TextIntroduction
    • Well

How to test this PR

  1. yarn test divider
  2. Observe that no components, other than Divider, are reported on
  3. yarn test
  4. Observe that the files included in the coverage report are restricted to elements from DSR

Upgrade @vitejs/plugin-react to 4.2.1
Upgrade @vitest/coverage-istanbul to 1.2.1
- Allow DS to render its own icons
- Resolve SVG import error
fix: Explicitly set test.coverage.all = false
Copy link

netlify bot commented Jan 26, 2024

Deploy Preview for cfpb-design-system-react ready!

Name Link
🔨 Latest commit 40435c0
🔍 Latest deploy log https://app.netlify.com/sites/cfpb-design-system-react/deploys/65f36f917b22a60008d52a8f
😎 Deploy Preview https://deploy-preview-291--cfpb-design-system-react.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.

@meissadia meissadia marked this pull request as ready for review February 2, 2024 23:05
@meissadia meissadia changed the title [WIP] Improve focus of test coverage reporting Improve focus of test coverage reporting Feb 2, 2024
@meissadia
Copy link
Contributor Author

Merge conflicts have been resolved. Ready for review.

@meissadia meissadia enabled auto-merge (squash) February 15, 2024 20:58
Copy link
Contributor

@billhimmelsbach billhimmelsbach left a comment

Choose a reason for hiding this comment

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

This is really great @meissadia. Thanks for checking this out!
Screenshot 2024-03-14 at 2 40 22 PM

@meissadia meissadia merged commit 6220f9e into main Mar 14, 2024
6 checks passed
@meissadia meissadia deleted the 290-focus-test-coverage branch March 14, 2024 21:45
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.

[Refactor] [Test files] Import components from implementation source
2 participants