Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(testing): clarify beforeAll in describe vs. outside #6294

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading