--- name: Update snapshots in `bun test` --- Bun's test runner supports Jest-style snapshot testing via `.toMatchSnapshot()`. {% callout %} The `.toMatchInlineSnapshot()` method is not yet supported. {% /callout %} ```ts#snap.test.ts import { test, expect } from "bun:test"; test("snapshot", () => { expect({ foo: "bar" }).toMatchSnapshot(); }); ``` --- The first time this test is executed, Bun will write a snapshot file to disk in a directory called `__snapshots__` that lives alongside the test file. ```txt test ├── __snapshots__ │   └── snap.test.ts.snap └── snap.test.ts ``` --- To regenerate snapshots, use the `--update-snapshots` flag. ```sh $ bun test --update-snapshots bun test v0.8.0 (9c68abdb) test/snap.test.ts: ✓ snapshot [0.86ms] 1 pass 0 fail snapshots: +1 added # the snapshot was regenerated 1 expect() calls Ran 1 tests across 1 files. [102.00ms] ``` --- See [Docs > Test Runner > Snapshots](/docs/test/mocks) for complete documentation on mocking with the Bun test runner. Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/integration/bunjs-only-snippets/wasm.js (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2022-04-04Update DockerfileGravatar Jarred Sumner 1-1/+17
2022-04-04Update tsconfig.jsonGravatar Jarred Sumner 1-0/+2
2022-04-04Update launch.jsonGravatar Jarred Sumner 1-0/+12
2022-04-04Update http-file.tsGravatar Jarred Sumner 1-3/+3
2022-04-04fix httpsGravatar Jarred Sumner 4-40/+109
2022-04-04Update bun.d.tsGravatar Jarred Sumner 1-5/+14
2022-04-04Fix error in bun:errorGravatar Jarred Sumner 1-1/+1
2022-04-04Add a couple more testsGravatar Jarred Sumner 1-0/+27
2022-04-04Make `Bun.file()` -> HTMLRewriter -> HTTP response workGravatar Jarred Sumner 5-72/+222
2022-04-04[bun] Don't allow `Transfer-Encoding` headerGravatar Jarred Sumner 1-0/+2
2022-04-04[bun.js] Improve error message for HTTP serverGravatar Jarred Sumner 1-4/+4
2022-04-04[bun.js] Support truncating file length up to u52Gravatar Jarred Sumner 1-7/+7