mirror of
https://github.com/oven-sh/bun
synced 2026-02-17 22:32:06 +00:00
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>
32 lines
798 B
TypeScript
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);
|