diff options
author | 2023-07-14 11:33:07 -0700 | |
---|---|---|
committer | 2023-07-14 11:33:07 -0700 | |
commit | 25512104265aa568ca98e5bd89a977203ee261a6 (patch) | |
tree | c6d0c4b0b0928e62d3ede6b17f8f272cd797ce94 | |
parent | 43abf2629ff228b19ff38a09f5423cf6f3863d84 (diff) | |
download | bun-25512104265aa568ca98e5bd89a977203ee261a6.tar.gz bun-25512104265aa568ca98e5bd89a977203ee261a6.tar.zst bun-25512104265aa568ca98e5bd89a977203ee261a6.zip |
Update docs
-rw-r--r-- | docs/api/utils.md | 14 | ||||
-rw-r--r-- | docs/cli/test.md | 2 |
2 files changed, 9 insertions, 7 deletions
diff --git a/docs/api/utils.md b/docs/api/utils.md index 2032d4acd..cf76769eb 100644 --- a/docs/api/utils.md +++ b/docs/api/utils.md @@ -149,7 +149,9 @@ test("peek", () => { // If we peek a rejected promise, it: // - returns the error // - does not mark the promise as handled - const rejected = Promise.reject(new Error("Successfully tested promise rejection")); + const rejected = Promise.reject( + new Error("Successfully tested promise rejection"), + ); expect(peek(rejected).message).toBe("Successfully tested promise rejection"); }); ``` @@ -283,7 +285,7 @@ console.log(url); // "file:///foo/bar.txt" ## `Bun.gzipSync()` -Compresses a `Uint8Array` using zlib's DEFLATE algorithm. +Compresses a `Uint8Array` using zlib's GZIP algorithm. ```ts const buf = Buffer.from("hello".repeat(100)); // Buffer extends Uint8Array @@ -372,7 +374,7 @@ export type ZlibCompressionOptions = { ## `Bun.gunzipSync()` -Uncompresses a `Uint8Array` using zlib's INFLATE algorithm. +Decompresses a `Uint8Array` using zlib's GUNZIP algorithm. ```ts const buf = Buffer.from("hello".repeat(100)); // Buffer extends Uint8Array @@ -400,15 +402,15 @@ The second argument supports the same set of configuration options as [`Bun.gzip ## `Bun.inflateSync()` -Uncompresses a `Uint8Array` using zlib's INFLATE algorithm. +DEcompresses a `Uint8Array` using zlib's INFLATE algorithm. ```ts const buf = Buffer.from("hello".repeat(100)); const compressed = Bun.deflateSync(buf); const dec = new TextDecoder(); -const uncompressed = Bun.inflateSync(compressed); -dec.decode(uncompressed); +const decompressed = Bun.inflateSync(compressed); +dec.decode(decompressed); // => "hellohellohello..." ``` diff --git a/docs/cli/test.md b/docs/cli/test.md index 7af8dcc20..209685042 100644 --- a/docs/cli/test.md +++ b/docs/cli/test.md @@ -69,7 +69,7 @@ See [Test > Lifecycle](/docs/test/lifecycle) for complete documentation. Create mocks with the `mock` function. Mocks are automatically reset between tests. -``` +```ts import { test, expect, mock } from "bun:test"; const random = mock(() => Math.random()); |