
ALT Line chart titled "51.4M Monthly Bun downloads." Downloads grow from 7.2M in October 2025 to 51.4M in October 2026, climbing fastest in the last few months. Four events are marked: Bun 1.3 in October 2025, Joined Anthropic in December, Rust rewrite in May, and Bun 1.4 in August. A label reads "+57% since 1.4."

ALT The Bun logo and the heading "$ bun test: Improved Vitest compatibility", above a Vitest test file with three lines highlighted and numbered: // @vitest-environment jsdom import { expect, test, vi } from "vitest"; import { track } from "./analytics"; import { toast } from "./toast"; vi.mock("./analytics"); test("toast hides after 3s", async () => { vi.useFakeTimers(); toast("Saved!"); expect(track).toHaveBeenCalled(); await vi.advanceTimersByTimeAsync(3000); expect(document.body.innerHTML).toBe(""); }); The highlighted lines: 1. DOM environments: the "@vitest-environment jsdom" comment 2. Automocks: vi.mock("./analytics") with no factory 3. Async fake timers: await vi.advanceTimersByTimeAsync(3000)








