Creates a mighty_component_test object from a rendered component,
enabling structured unit testing with optional coverage checking.
See mighty_component_test for a description of the testing workflow.
Usage
get_test_component(
component,
params = list(),
check_coverage = TRUE,
teardown_env = parent.frame()
)Arguments
- component
characterspecifying either a standard component name or path to a custom component file (R or Mustache template).- params
named
listof input parameters. Passed along tomighty_component$render().- check_coverage
logical(1)Whether to automatically check test coverage when the test completes. IfTRUE(default), coverage is verified viatest_component$check_coverage()in a deferred call.- teardown_env
The environment in which to register the deferred coverage check. Defaults to the caller's environment (
parent.frame()). This controls whencheck_coverage()executes during test teardown.
