TestResult
The result of your hard work.
Test results are pure data classes with some deprecated convenience methods. They have the following supported shape:
1
export declare class TestResult implements ILogTarget {
2
/** The actual test's name or description. */
3
name: string;
4
5
/** The indicator to see if the test passed. */
6
pass: boolean;
7
8
/** The indicated to see if a test actually ran. */
9
ran: boolean;
10
11
/** The reported actual value description, if it failed. */
12
actual: ReflectedValue | null;
13
14
/** The reported expected value description, if it failed. */
15
expected: ReflectedValue | null;
16
17
/** If the test failed, this is the message describing why the test failed. */
18
message: string;
19
20
/** A set of logged values during the test. */
21
logs: ReflectedValue[];
22
23
/** The generated stack trace if the test errored. */
24
stack: string | null;
25
26
/** This value is set to true if the test is expected to throw. */
27
negated: boolean;
28
29
/** This is the timestamp for when the test started in milliseconds. */
30
start: number;
31
32
/** This is the timestamp for when the test ended in milliseconds. */
33
end: number;
34
35
/** This is the run time for the test in milliseconds. */
36
runTime: number;
37
38
/** A set of errors that were reported for this test. */
39
errors: IWarning[];
40
41
/** A set of warnings that were reported for this test. */
42
warnings: IWarning[];
43
}
Copied!
A lot of the public properties on the TestResult class will be deprecated and consolidated by version 4.0.0.
Last modified 2yr ago
Copy link