Utilities
defineTestCheck
defineTestCheck
wraps your checks and decorates these functions with sensible defaults for the CheckContext
that is passed to your message, validate and fix functions that you can override.
This cuts down on repetitive boilerplate when writing tests for your checks.
Parameters
An object containing metadata about the package the check is being run against.
Returns
Returns the original check function, however the validate
, fix
, and message
functions
will be passed the defaults in TestCheckContext
rather than requiring that all properties CheckContext
are explicitly passed when testing check methods.
Example
Was this page helpful?