Files
bun.sh/test/integration/vite-build/vite-build.test.ts
Jarred Sumner 2e02d9de28 Use ReadableStream.prototype.* in tests instead of new Response(...).* (#20937)
Co-authored-by: Jarred-Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Alistair Smith <hi@alistair.sh>
Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude <noreply@anthropic.com>
2025-07-14 00:47:53 -07:00

32 lines
798 B
TypeScript

import { expect, test } from "bun:test";
import fs from "fs";
import { bunExe, bunEnv as env, tmpdirSync } from "harness";
import path from "path";
test("vite build works", async () => {
const testDir = tmpdirSync();
fs.cpSync(path.join(import.meta.dir, "the-test-app"), testDir, { recursive: true, force: true });
const { exited: installExited } = Bun.spawn({
cmd: [bunExe(), "install", "--ignore-scripts"],
cwd: testDir,
env,
});
expect(await installExited).toBe(0);
const { stdout, stderr, exited } = Bun.spawn({
cmd: [bunExe(), "node_modules/vite/bin/vite.js", "build"],
cwd: testDir,
stdout: "pipe",
stderr: "inherit",
env,
});
expect(await exited).toBe(0);
const out = await stdout.text();
expect(out).toContain("done");
}, 60_000);