@@ -33,40 +33,68 @@ export type CommitDiscardOptions = {
33
33
} ;
34
34
35
35
export interface Assertions {
36
- /** Assert that `actual` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy). Comes with power-assert. */
36
+ /**
37
+ * Assert that `actual` is
38
+ * [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy),
39
+ * returning Boolean indicating whether the assertion passes. Comes with
40
+ * power-assert.
41
+ */
37
42
assert : AssertAssertion ;
38
43
39
- /** Assert that `actual` is [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to `expected`. */
44
+ /**
45
+ * Assert that `actual` is [deeply
46
+ * equal](https://github.com/concordancejs/concordance#comparison-details) to
47
+ * `expected`, returning Boolean indicating whether the assertion passes.
48
+ */
40
49
deepEqual : DeepEqualAssertion ;
41
50
42
- /** Assert that `actual` is like `expected`. */
51
+ /**
52
+ * Assert that `value` is like `selector`, returning Boolean indicating
53
+ * whether the assertion passes.
54
+ */
43
55
like : LikeAssertion ;
44
56
45
- /** Fail the test. */
57
+ /** Fail the test, always returning `false` . */
46
58
fail : FailAssertion ;
47
59
48
- /** Assert that `actual` is strictly false. */
60
+ /**
61
+ * Assert that `actual` is strictly false, returning Boolean indicating
62
+ * whether the assertion passes.
63
+ */
49
64
false : FalseAssertion ;
50
65
51
- /** Assert that `actual` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy). */
66
+ /**
67
+ * Assert that `actual` is
68
+ * [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy), returning
69
+ * Boolean whether the assertion passes.
70
+ */
52
71
falsy : FalsyAssertion ;
53
72
54
73
/**
55
74
* Assert that `actual` is [the same
56
- * value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) as `expected`.
75
+ * value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)
76
+ * as `expected`, returning Boolean indicating whether the assertion passes.
57
77
*/
58
78
is : IsAssertion ;
59
79
60
80
/**
61
81
* Assert that `actual` is not [the same
62
- * value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) as `expected`.
82
+ * value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)
83
+ * as `expected`, returning Boolean indicating whether the assertion passes.
63
84
*/
64
85
not : NotAssertion ;
65
86
66
- /** Assert that `actual` is not [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to `expected`. */
87
+ /**
88
+ * Assert that `actual` is not [deeply
89
+ * equal](https://github.com/concordancejs/concordance#comparison-details) to
90
+ * `expected`, returning Boolean indicating whether the assertion passes.
91
+ */
67
92
notDeepEqual : NotDeepEqualAssertion ;
68
93
69
- /** Assert that `string` does not match the regular expression. */
94
+ /**
95
+ * Assert that `string` does not match the regular expression, returning
96
+ * Boolean indicating whether the assertion passes.
97
+ */
70
98
notRegex : NotRegexAssertion ;
71
99
72
100
/** Assert that the function does not throw. */
@@ -75,10 +103,13 @@ export interface Assertions {
75
103
/** Assert that the async function does not throw, or that the promise does not reject. Must be awaited. */
76
104
notThrowsAsync : NotThrowsAsyncAssertion ;
77
105
78
- /** Count a passing assertion. */
106
+ /** Count a passing assertion, always returning `true` . */
79
107
pass : PassAssertion ;
80
108
81
- /** Assert that `string` matches the regular expression. */
109
+ /**
110
+ * Assert that `string` matches the regular expression, returning Boolean
111
+ * indicating whether the assertion passes.
112
+ */
82
113
regex : RegexAssertion ;
83
114
84
115
/**
@@ -99,56 +130,82 @@ export interface Assertions {
99
130
*/
100
131
throwsAsync : ThrowsAsyncAssertion ;
101
132
102
- /** Assert that `actual` is strictly true. */
133
+ /**
134
+ * Assert that `actual` is strictly true, returning Boolean indicating
135
+ * whether the assertion passes.
136
+ */
103
137
true : TrueAssertion ;
104
138
105
- /** Assert that `actual` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy). */
139
+ /**
140
+ * Assert that `actual` is
141
+ * [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy),
142
+ * returning Boolean indicating whether the assertion passes.
143
+ */
106
144
truthy : TruthyAssertion ;
107
145
}
108
146
109
147
export interface AssertAssertion {
110
- /** Assert that `actual` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy). Comes with power-assert. */
111
- ( actual : any , message ?: string ) : void ;
148
+ /**
149
+ * Assert that `actual` is
150
+ * [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy),
151
+ * returning Boolean indicating whether the assertion passes. Comes with
152
+ * power-assert.
153
+ */
154
+ ( actual : any , message ?: string ) : boolean ;
112
155
113
156
/** Skip this assertion. */
114
157
skip ( actual : any , message ?: string ) : void ;
115
158
}
116
159
117
160
export interface DeepEqualAssertion {
118
- /** Assert that `actual` is [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to `expected`. */
119
- < ValueType = any > ( actual : ValueType , expected : ValueType , message ?: string ) : void ;
161
+ /**
162
+ * Assert that `actual` is [deeply
163
+ * equal](https://github.com/concordancejs/concordance#comparison-details) to
164
+ * `expected`, returning Boolean indicating whether the assertion passes.
165
+ */
166
+ < ValueType = any > ( actual : ValueType , expected : ValueType , message ?: string ) : boolean ;
120
167
121
168
/** Skip this assertion. */
122
169
skip ( actual : any , expected : any , message ?: string ) : void ;
123
170
}
124
171
125
172
export interface LikeAssertion {
126
- /** Assert that `value` is like `selector`. */
127
- ( value : any , selector : Record < string , any > , message ?: string ) : void ;
173
+ /**
174
+ * Assert that `value` is like `selector`, returning Boolean indicating
175
+ * whether the assertion passes.
176
+ */
177
+ ( value : any , selector : Record < string , any > , message ?: string ) : boolean ;
128
178
129
179
/** Skip this assertion. */
130
180
skip ( value : any , selector : any , message ?: string ) : void ;
131
181
}
132
182
133
183
export interface FailAssertion {
134
- /** Fail the test. */
135
- ( message ?: string ) : void ;
184
+ /** Fail the test, always returning `false` . */
185
+ ( message ?: string ) : boolean ;
136
186
137
187
/** Skip this assertion. */
138
188
skip ( message ?: string ) : void ;
139
189
}
140
190
141
191
export interface FalseAssertion {
142
- /** Assert that `actual` is strictly false. */
143
- ( actual : any , message ?: string ) : void ;
192
+ /**
193
+ * Assert that `actual` is strictly false, returning Boolean indicating
194
+ * whether the assertion passes.
195
+ */
196
+ ( actual : any , message ?: string ) : boolean ;
144
197
145
198
/** Skip this assertion. */
146
199
skip ( actual : any , message ?: string ) : void ;
147
200
}
148
201
149
202
export interface FalsyAssertion {
150
- /** Assert that `actual` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy). */
151
- ( actual : any , message ?: string ) : void ;
203
+ /**
204
+ * Assert that `actual` is
205
+ * [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy), returning
206
+ * Boolean whether the assertion passes.
207
+ */
208
+ ( actual : any , message ?: string ) : boolean ;
152
209
153
210
/** Skip this assertion. */
154
211
skip ( actual : any , message ?: string ) : void ;
@@ -157,9 +214,10 @@ export interface FalsyAssertion {
157
214
export interface IsAssertion {
158
215
/**
159
216
* Assert that `actual` is [the same
160
- * value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) as `expected`.
217
+ * value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)
218
+ * as `expected`, returning Boolean indicating whether the assertion passes.
161
219
*/
162
- < ValueType = any > ( actual : ValueType , expected : ValueType , message ?: string ) : void ;
220
+ < ValueType = any > ( actual : ValueType , expected : ValueType , message ?: string ) : boolean ;
163
221
164
222
/** Skip this assertion. */
165
223
skip ( actual : any , expected : any , message ?: string ) : void ;
@@ -168,25 +226,33 @@ export interface IsAssertion {
168
226
export interface NotAssertion {
169
227
/**
170
228
* Assert that `actual` is not [the same
171
- * value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) as `expected`.
229
+ * value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)
230
+ * as `expected`, returning Boolean indicating whether the assertion passes.
172
231
*/
173
- < ValueType = any > ( actual : ValueType , expected : ValueType , message ?: string ) : void ;
232
+ < ValueType = any > ( actual : ValueType , expected : ValueType , message ?: string ) : boolean ;
174
233
175
234
/** Skip this assertion. */
176
235
skip ( actual : any , expected : any , message ?: string ) : void ;
177
236
}
178
237
179
238
export interface NotDeepEqualAssertion {
180
- /** Assert that `actual` is not [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to `expected`. */
181
- < ValueType = any > ( actual : ValueType , expected : ValueType , message ?: string ) : void ;
239
+ /**
240
+ * Assert that `actual` is not [deeply
241
+ * equal](https://github.com/concordancejs/concordance#comparison-details) to
242
+ * `expected`, returning Boolean indicating whether the assertion passes.
243
+ */
244
+ < ValueType = any > ( actual : ValueType , expected : ValueType , message ?: string ) : boolean ;
182
245
183
246
/** Skip this assertion. */
184
247
skip ( actual : any , expected : any , message ?: string ) : void ;
185
248
}
186
249
187
250
export interface NotRegexAssertion {
188
- /** Assert that `string` does not match the regular expression. */
189
- ( string : string , regex : RegExp , message ?: string ) : void ;
251
+ /**
252
+ * Assert that `string` does not match the regular expression, returning
253
+ * Boolean indicating whether the assertion passes.
254
+ */
255
+ ( string : string , regex : RegExp , message ?: string ) : boolean ;
190
256
191
257
/** Skip this assertion. */
192
258
skip ( string : string , regex : RegExp , message ?: string ) : void ;
@@ -212,16 +278,19 @@ export interface NotThrowsAsyncAssertion {
212
278
}
213
279
214
280
export interface PassAssertion {
215
- /** Count a passing assertion. */
216
- ( message ?: string ) : void ;
281
+ /** Count a passing assertion, always returning `true` . */
282
+ ( message ?: string ) : boolean ;
217
283
218
284
/** Skip this assertion. */
219
285
skip ( message ?: string ) : void ;
220
286
}
221
287
222
288
export interface RegexAssertion {
223
- /** Assert that `string` matches the regular expression. */
224
- ( string : string , regex : RegExp , message ?: string ) : void ;
289
+ /**
290
+ * Assert that `string` matches the regular expression, returning Boolean
291
+ * indicating whether the assertion passes.
292
+ */
293
+ ( string : string , regex : RegExp , message ?: string ) : boolean ;
225
294
226
295
/** Skip this assertion. */
227
296
skip ( string : string , regex : RegExp , message ?: string ) : void ;
@@ -280,16 +349,23 @@ export interface ThrowsAsyncAssertion {
280
349
}
281
350
282
351
export interface TrueAssertion {
283
- /** Assert that `actual` is strictly true. */
284
- ( actual : any , message ?: string ) : void ;
352
+ /**
353
+ * Assert that `actual` is strictly true, returning Boolean indicating
354
+ * whether the assertion passes.
355
+ */
356
+ ( actual : any , message ?: string ) : boolean ;
285
357
286
358
/** Skip this assertion. */
287
359
skip ( actual : any , message ?: string ) : void ;
288
360
}
289
361
290
362
export interface TruthyAssertion {
291
- /** Assert that `actual` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy). */
292
- ( actual : any , message ?: string ) : void ;
363
+ /**
364
+ * Assert that `actual` is
365
+ * [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy),
366
+ * returning Boolean indicating whether the assertion passes.
367
+ */
368
+ ( actual : any , message ?: string ) : boolean ;
293
369
294
370
/** Skip this assertion. */
295
371
skip ( actual : any , message ?: string ) : void ;
0 commit comments