Skip to content

Commit

Permalink
docs(bdd): clarify beforeAll in describe vs. outside
Browse files Browse the repository at this point in the history
  • Loading branch information
dandv authored Dec 22, 2024
1 parent d625a03 commit fbb5401
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 fbb5401

Please sign in to comment.