TestifyHintRule Module
Helpers for building reusable hint rules.
Functions and values
| Function or value |
Description
|
Full Usage:
TestifyHintRule.create name tryInfer
Parameters:
string
-
The stable rule name.
tryInfer : TestifyFailureReport -> string option
-
The callback that inspects the failure report and optionally returns a hint.
Returns: TestifyHintRule
A hint rule that can be enabled directly or added to a hint pack.
|
Creates a hint rule from an arbitrary inference callback.
Example
val exceptionHint: obj
union case Option.Some: Value: 'T -> Option<'T>
union case Option.None: Option<'T>
|
Full Usage:
TestifyHintRule.onFieldRegex name field pattern buildHint
Parameters:
string
-
The stable rule name.
field : HintTextField
-
The report field whose text should be inspected.
pattern : Regex
-
The compiled regex used to detect the hint condition.
buildHint : Match -> string
-
Builds the final hint text from the successful regex match.
Returns: TestifyHintRule
A hint rule that only fires when the selected field matches the regex.
|
Creates a regex-based hint rule against one selected report field.
|
Full Usage:
TestifyHintRule.onFieldRegexPattern name field pattern buildHint
Parameters:
string
-
The stable rule name.
field : HintTextField
-
The report field whose text should be inspected.
pattern : string
-
The regex pattern string used to build a compiled regex.
buildHint : Match -> string
-
Builds the final hint text from the successful regex match.
Returns: TestifyHintRule
A hint rule that only fires when the selected field matches the compiled regex.
|
Creates a regex-based hint rule from a regex pattern string.
Example
val trailingWhitespace: obj
|
testify