aboutsummaryrefslogtreecommitdiff
path: root/docs/test/lifecycle.md
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2023-07-11 19:14:34 -0700
committerGravatar GitHub <noreply@github.com> 2023-07-11 19:14:34 -0700
commitcbb88672f217a90db1aa1eb29cd92d5d9035b22b (patch)
tree43a00501f3cde495967e116f0b660777051551f8 /docs/test/lifecycle.md
parent1f900cff453700b19bca2acadfe26da4468c1282 (diff)
parent34b0e7a2bbd8bf8097341cdb0075d0908283e834 (diff)
downloadbun-jarred/esm-conditions.tar.gz
bun-jarred/esm-conditions.tar.zst
bun-jarred/esm-conditions.zip
Merge branch 'main' into jarred/esm-conditionsjarred/esm-conditions
Diffstat (limited to '')
-rw-r--r--docs/test/lifecycle.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/test/lifecycle.md b/docs/test/lifecycle.md
index ccb7ce85d..fd804c9bb 100644
--- a/docs/test/lifecycle.md
+++ b/docs/test/lifecycle.md
@@ -10,7 +10,7 @@ The test runner supports the following lifecycle hooks. This is useful for loadi
Perform per-test setup and teardown logic with `beforeEach` and `afterEach`.
```ts
-import { expect, test } from "bun:test";
+import { beforeEach, afterEach } from "bun:test";
beforeEach(() => {
console.log("running test.");
@@ -70,7 +70,7 @@ afterAll(() => {
Then use `--preload` to run the setup script before any test files.
```ts
-bun test --preload ./setup.ts
+$ bun test --preload ./setup.ts
```
To avoid typing `--preload` every time you run tests, it can be added to your `bunfig.toml`: