mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
### What does this PR do? ### How did you verify your code works? --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
38 lines
912 B
TypeScript
38 lines
912 B
TypeScript
import { expect, test } from "bun:test";
|
|
import fs from "fs";
|
|
import { bunExe, bunEnv as env, isASAN, tmpdirSync } from "harness";
|
|
import path from "path";
|
|
|
|
const ASAN_MULTIPLIER = isASAN ? 3 : 1;
|
|
|
|
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 * ASAN_MULTIPLIER,
|
|
);
|