From fbb540164c0251a3c482e74763f9be39a9c3c19e Mon Sep 17 00:00:00 2001 From: Dan Dascalescu Date: Sun, 22 Dec 2024 22:53:40 +0200 Subject: [PATCH] docs(bdd): clarify beforeAll in describe vs. outside --- testing/bdd.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/testing/bdd.ts b/testing/bdd.ts index 1c0c32d7ebb6..7945bd575dee 100644 --- a/testing/bdd.ts +++ b/testing/bdd.ts @@ -19,10 +19,10 @@ * the test case passes. The *All hooks will be called once for the whole group * while the *Each hooks will be called for each individual test case. * - * - `beforeAll`: Runs before all of the tests in the test suite. - * - `afterAll`: Runs after all of the tests in the test suite finish. - * - `beforeEach`: Runs before each of the individual test cases in the test suite. - * - `afterEach`: Runs after each of the individual test cases in the test suite. + * - `beforeAll`: Runs before all of the tests in the group. + * - `afterAll`: Runs after all of the tests in the group finish. + * - `beforeEach`: Runs before each of the individual test cases in the group. + * - `afterEach`: Runs after each of the individual test cases in the group. * * If a hook is registered at the top level, a global test suite will be registered * and all tests will belong to it. Hooks registered at the top level must be @@ -836,9 +836,9 @@ function addHook( } /** - * Run some shared setup before all of the tests in the suite. - * `beforeAll` is only provided for compatibility. Top-level - * initialization code should be used instead. + * Run some shared setup before all of the tests in the group. + * Useful for async setup in `describe` blocks. Outside them, + * top-level initialization code should be used instead. * * @example Usage * ```ts