Skip to content
masterclass Buddy

Jest · Function

afterAll

afterAll runs a cleanup function after all tests in its scope finish. It can wait for asynchronous cleanup and accepts an optional timeout.

Last updated

Syntax

afterAll(fn, timeout)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • afterEach
  • beforeAll
  • beforeEach
  • describe
  • test

Source: Globals · Jest. Checked 2026-11-03.