Skip to content
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/api/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -1420,6 +1420,8 @@ describe('tests', async () => {
});
```

**Note:** The `after` hook is guaranteed to run, even if tests within the suite fail.

## `beforeEach([fn][, options])`

<!-- YAML
Expand Down Expand Up @@ -1473,6 +1475,9 @@ added:
This function is used to create a hook running
after each subtest of the current test.

**Note:** The `afterEach` hook is guaranteed to run after every test,
even if any of the tests fail.

```js
describe('tests', async () => {
afterEach(() => console.log('finished running a test'));
Expand Down