@@ -17,61 +17,86 @@ export interface SnapshotOptions {
1717 id ?: string ;
1818}
1919
20- // When an assert fail, the message string will be shown in the error
2120export interface Assertions {
22- // Assert that actual is deep equal to expected
21+ /** Assert that ` actual` is deep equal to ` expected` */
2322 deepEqual < ValueType = any > ( actual : ValueType , expected : ValueType , message ?: string ) : void ;
24- // Failing assertion
23+
24+ /** Cause the test to fail */
2525 fail ( message ?: string ) : void ;
26- // Assert that actual is equal to false
26+
27+ /** Assert that `actual` is equal to false */
2728 false ( actual : any , message ?: string ) : void ;
28- // Assert that actual is falsy (false, 0, '', "", null, undefined, NaN)
29+
30+ /** Assert that `actual` is falsy (false, 0, '', null, undefined, NaN) */
2931 falsy ( actual : any , message ?: string ) : void ;
30- // Assert that error is falsy
32+
33+ /** Assert that `error` is falsy */
3134 ifError ( error : any , message ?: string ) : void ;
32- // Assert that actual is equal to expected (use deepEqual for objects/arrays)
35+
36+ /** Assert that `actual` is strictly equal to `expected` */
3337 is < ValueType = any > ( actual : ValueType , expected : ValueType , message ?: string ) : void ;
34- // Assert that actual is not equal to expected (use notDeepEqual for objects/arrays)
38+
39+ /** Assert that `actual` is not strictly equal to `expected` */
3540 not < ValueType = any > ( actual : ValueType , expected : ValueType , message ?: string ) : void ;
36- // Assert that actual is not deep equal to expected
41+
42+ /** Assert that `actual` is not deep equal to `expected` */
3743 notDeepEqual < ValueType = any > ( actual : ValueType , expected : ValueType , message ?: string ) : void ;
38- // Assert that string does not follow the regex pattern
44+
45+ /** Assert that `string` does not match the regex pattern */
3946 notRegex ( string : string , regex : RegExp , message ?: string ) : void ;
40- // Assert that a function that never returns does not throw an error
47+
48+ /** Assert that a function does not throw */
4149 notThrows ( value : ( ) => never , message ?: string ) : void ;
42- // Assert that a function that returns an observable does not throw an error
50+
51+ /** Assert that a function that returns an observable does not throw */
4352 notThrows ( value : ( ) => ObservableLike , message ?: string ) : Promise < void > ;
44- // Assert that a function that returns a promise does not throw an error
53+
54+ /** Assert that a function that returns a promise throws an error */
4555 notThrows ( value : ( ) => PromiseLike < any > , message ?: string ) : Promise < void > ;
46- // Assert that a function that returns any value does not throw an error
56+
57+ /** Assert that a function does not throw */
4758 notThrows ( value : ( ) => any , message ?: string ) : void ;
48- // Assert that an observable does not throw an error
59+
60+ /** Assert that an observable does not throw */
4961 notThrows ( value : ObservableLike , message ?: string ) : Promise < void > ;
50- // Assert that a promise does not throw an error
62+
63+ /** Assert that a promise does not throw */
5164 notThrows ( value : PromiseLike < any > , message ?: string ) : Promise < void > ;
52- // Passing assertion
65+
66+ /** Passing assertion */
5367 pass ( message ?: string ) : void ;
54- // Assert that string follows the regex pattern
68+
69+ /** Assert that string match the regex pattern */
5570 regex ( string : string , regex : RegExp , message ?: string ) : void ;
56- // Assert that expected matches a snapshot
71+
72+ /** Assert that expected matches a snapshot */
5773 snapshot ( expected : any , message ?: string ) : void ;
58- // Assert that expected matches a snapshot with option `id`
74+
75+ /** Assert that expected matches a snapshot with option `id` */
5976 snapshot ( expected : any , options : SnapshotOptions , message ?: string ) : void ;
60- // Assert that a function that never returns throws an error
77+
78+ /** Assert that a function that returns any value throws an error */
6179 throws ( value : ( ) => never , error ?: ThrowsErrorValidator , message ?: string ) : any ;
62- // Assert that a function that returns an observable throws an error
80+
81+ /** Assert that a function that returns an observable throws an error */
6382 throws ( value : ( ) => ObservableLike , error ?: ThrowsErrorValidator , message ?: string ) : Promise < any > ;
64- // Assert that a function that returns a promise throws an error
83+
84+ /** Assert that a function that returns a promise throws an error */
6585 throws ( value : ( ) => PromiseLike < any > , error ?: ThrowsErrorValidator , message ?: string ) : Promise < any > ;
66- // Assert that a function that returns any value throws an error
86+
87+ /** Assert that a function that returns any value throws an error */
6788 throws ( value : ( ) => any , error ?: ThrowsErrorValidator , message ?: string ) : any ;
68- // Assert that an observable throws an error
89+
90+ /** Assert that an observable throws an error */
6991 throws ( value : ObservableLike , error ?: ThrowsErrorValidator , message ?: string ) : Promise < any > ;
70- // Assert that a promise throws an error
92+
93+ /** Assert that a promise throws an error */
7194 throws ( value : PromiseLike < any > , error ?: ThrowsErrorValidator , message ?: string ) : Promise < any > ;
72- // Assert that actual is equal to true
95+
96+ /** Assert that actual is equal to true */
7397 true ( actual : any , message ?: string ) : void ;
74- // Assert that actual is truthy ('0', 'false', [], {}, function() {}, etc.)
98+
99+ /** Assert that actual is truthy ('0', 'false', [], {}, function() {}, etc.) */
75100 truthy ( actual : any , message ?: string ) : void ;
76101}
77102
0 commit comments