Skip to content

Add cleanup hook helpers#3447

Closed
Cosmhyccc wants to merge 2 commits into
avajs:mainfrom
Cosmhyccc:codex/ava-cleanup-hooks
Closed

Add cleanup hook helpers#3447
Cosmhyccc wants to merge 2 commits into
avajs:mainfrom
Cosmhyccc:codex/ava-cleanup-hooks

Conversation

@Cosmhyccc

@Cosmhyccc Cosmhyccc commented May 12, 2026

Copy link
Copy Markdown

Fixes #928

Summary

  • Add test.cleanup() and test.cleanupEach() hook chains, including test.serial variants.
  • Expand cleanup hooks into existing lifecycle hooks: before + after.always, and beforeEach + afterEach.always.
  • Document the helpers, update TypeScript declarations, and cover passing/failing test behavior.

Verification

  • PATH=/Users/saifali/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:$PATH npx tsc --noEmit
  • PATH=/Users/saifali/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:$PATH npx tap test-tap/hooks.js
  • CI: Lint source files passed after the switch refactor.

@sindresorhus

Copy link
Copy Markdown
Member

We don't accept fully AI-generated PRs.

@avajs avajs locked as spam and limited conversation to collaborators May 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make it easier to write reliable cleanup tasks

2 participants