Skip to content

Commit

Permalink
docs(testing): clarify beforeAll in describe vs. outside (#6294)
Browse files Browse the repository at this point in the history
  • Loading branch information
dandv authored Dec 23, 2024
1 parent c65c048 commit ed52423
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions testing/bdd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -836,9 +836,9 @@ function addHook<T>(
}

/**
* 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
Expand Down

0 comments on commit ed52423

Please sign in to comment.