mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 03:18:53 +00:00
* Move ReadFile and WriteFile to separate file * Use libuv for Bun.write() * Update windows_event_loop.zig * build * Get bun-write tests to pass. Implement Bun.write with two files. * UPdate * Update * Update failing test list * update * More * More * More * More * Mark the rest * ok * oops * Update bun-write.test.js * Update blob.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: Dave Caruso <me@paperdave.net> Co-authored-by: Georgijs Vilums <georgijs.vilums@gmail.com>
26 lines
655 B
TypeScript
26 lines
655 B
TypeScript
import { test, expect } from "bun:test";
|
|
|
|
test("fetch brotli response works", async () => {
|
|
const [firstText, secondText, { headers }] = await Promise.all([
|
|
fetch("https://bun.sh/logo.svg", {
|
|
headers: {
|
|
"Accept-Encoding": "br",
|
|
},
|
|
}).then(res => res.text()),
|
|
fetch("https://bun.sh/logo.svg", {
|
|
headers: {
|
|
"Accept-Encoding": "gzip",
|
|
},
|
|
}).then(res => res.text()),
|
|
fetch("https://bun.sh/logo.svg", {
|
|
headers: {
|
|
"Accept-Encoding": "br",
|
|
},
|
|
decompress: false,
|
|
}),
|
|
]);
|
|
|
|
expect(firstText).toBe(secondText);
|
|
expect(headers.get("Content-Encoding")).toBe("br");
|
|
});
|