Get started with the Autoblocks Testing SDK for TypeScript.
input
property on its hyphens and randomly discarding some of the substrings
to simulate failures on the has-all-substrings
evaluator.
Evaluation
to a test case’s output,
where the output is the result of running the test case through the function you are testing.
Your test suite can have multiple evaluators.
The evaluation method that you implement on the evaluator will have access to both the test case
instance and the output of the test function over the given test case. Your evaluation method
can be synchronous or asynchronous, but it must return an instance of Evaluation
.
The evaluation must have a score between 0 and 1, and you can optionally attach a
Threshold
that describes the range the score must be in in order
to be considered passing. If no threshold is attached, the score is reported and the pass / fail
status is undefined. Evaluations can also have metadata attached to them, which can be useful
for providing additional context when an evaluation fails.
For this example we’ll define two evaluators:
autoblocks testing exec
command will show the progress of all test suites in your terminal
and also send the results to Autoblocks:
You can view details of the results by clicking on the link displayed in the terminal or by visiting
the test suites page in the Autoblocks platform.