Merged
Conversation
5 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Code coverage
|
Github pagesReview the pkgdown webpage for the PR here |
akselthomsen
commented
Feb 9, 2026
akselthomsen
commented
Feb 9, 2026
matthew-phelps
approved these changes
Feb 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates the unit testing workflow for a component.
A component being tested now has it's own class (
mighty_component_test) that tracks test coverage,and a separate and dedicated child R session to execute code in.
The new workflow is a follows:
get_test_component()$assign()$eval()$get()expect_*()functions from{testthat}The best way to see how a user will test components is see the updated
tests/testthat/test-components.Rthat tests the dummy standard components currently inside the package.I decided not to create a separate testing vignette in this PR.
I will include testing as part of the Getting Started vignette in #28.
Changes Made
mighty_component_testclass. Inheriting frommighty_component_rendered.get_test_component()function. On exit it by default checks if all lines of the test component has been covered by unit tests.mighty_component_testhas methods to$assign()and$get()variables from the child R session. Theprint()method also displays code coverage (in total and by each line).$eval()method formighty_component_renderedto print evaluated code to the console using zephyrverbosity_leveloption to suppress it. This was part of a previous iteration on the test development, but I liked it so much I wanted to keep it..selfin examplesTesting
mighty_component_testthat checks if the workflow and coverage checks work. Snapshots for tracking the development in code coverage with the printing method.Checklist