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(),
repos = NULL,
check_coverage = TRUE,
teardown_env = parent.frame()
)Arguments
- component
characterpath to a component file (.Ror.mustache).- params
named
listof input parameters. Passed along tomighty_component$render().- repos
prioritised
charactervector of locations to look for component in. See details.- 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.
