You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/03-assertions.md
+2-6Lines changed: 2 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -229,7 +229,7 @@ Finally, this returns a boolean indicating whether the assertion passed.
229
229
230
230
### `.throws(fn, expectation?, message?)`
231
231
232
-
Assert that an error is thrown. `fn` must be a function which should throw. The thrown value *must* be an error. It is returned so you can run more assertions against it.
232
+
Assert that an error is thrown. `fn` must be a function which should throw. The thrown value *must* be an error. It is returned so you can run more assertions against it. If the assertion fails then `null` is returned.
233
233
234
234
`expectation` can be an object with one or more of the following properties:
Assert that an error is thrown. `thrower` can be an async function which should throw, or a promise that should reject. This assertion must be awaited.
265
263
266
-
The thrown value *must* be an error. It is returned so you can run more assertions against it.
264
+
The thrown value *must* be an error. It is returned so you can run more assertions against it. If the assertion fails then `null` is returned.
267
265
268
266
`expectation` can be an object with one or more of the following properties:
269
267
@@ -294,8 +292,6 @@ test('rejects', async t => {
294
292
});
295
293
```
296
294
297
-
Does not return anything.
298
-
299
295
### `.notThrows(fn, message?)`
300
296
301
297
Assert that no error is thrown. `fn` must be a function which shouldn't throw. Does not return anything.
0 commit comments