# @tapjs/after-each

> a built-in tap extension for t.afterEach()

Latest version **4.3.12** (published 2026-09-03) · BlueOak-1.0.0 license · 0 weekly downloads

## Install

```sh
npm install @tapjs/after-each
pnpm add @tapjs/after-each
yarn add @tapjs/after-each
bun add @tapjs/after-each
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.3.12 |
| Published | 2026-09-03 |
| First published | 2023-08-04 |
| Weekly downloads | 0 |
| License | BlueOak-1.0.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | 20 \|\| >=22 |
| Dependencies | 1 |
| Unpacked size | 17.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2423 |
| Author | Isaac Z. Schlueter |
| Maintainers | ljharb, isaacs |
| Keywords | tapjs plugin |

## Links

- npm: https://www.npmjs.com/package/@tapjs/after-each
- Repository: https://github.com/tapjs/tapjs
- Homepage: https://github.com/tapjs/tapjs/tree/main/src/after-each#readme
- Issues: https://github.com/tapjs/tapjs/issues
- npm.io page: https://npm.io/package/@tapjs/after-each

## Dependencies (1)

- [function-loop](https://npm.io/package/function-loop.md) ^4.0.0

## Recent versions

- 4.3.12 (latest) — 2026-09-03
- 1.0.0 (pre) — 2023-09-15
- 4.3.11 — 2026-07-27
- 4.3.10 — 2026-05-15
- 4.3.9 — 2026-05-13
- 4.3.8 — 2026-05-01
- 4.3.7 — 2026-04-17
- 4.3.6 — 2026-04-15
- 4.3.5 — 2026-04-05
- 4.3.4 — 2026-02-20
- 4.3.3 — 2026-02-18
- 4.3.2 — 2026-02-18
- 4.3.1 — 2026-02-05
- 4.3.0 — 2025-12-01
- 4.2.1 — 2025-11-26
- … 76 more at https://npm.io/package/@tapjs/after-each/versions

## README

# `@tapjs/after-each`

A default tap plugin providing `t.afterEach()`.

## USAGE

This plugin is installed with tap by default. If you had
previously removed it, you can `tap plugin add @tapjs/after-each` to
bring it back.

```ts
import t from 'tap'
t.afterEach(t => {
  // this will run after each child test, all of their child
  // tests, and so on
  // the parameter is the child test that just ended.
})
```

If the method returns a promise, it will be awaited before moving
on to the next test.

The `afterEach` method is called for _all_ child tests, not just
direct children. "Closer" ancestor `afterEach` methods are called
before further ancestors.

For example, this test:

```js
import t from 'tap'
t.afterEach(t => {
  console.error('root after each', t.name)
})

t.test('parent test', t => {
  t.afterEach(t => {
    console.error('parent after each', t.name)
  })
  t.test('child test', t => t.end())
  t.end()
})
```

will print:

```
parent after each child test
root after each child test
root after each parent test
```

---
_Source: https://npm.io/package/@tapjs/after-each · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
