-
Notifications
You must be signed in to change notification settings - Fork 2.8k
/
Copy pathexpo.test.ts
36 lines (31 loc) · 933 Bytes
/
expo.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { beforeAll, expect, setDefaultTimeout, test } from "bun:test";
import fs from "fs/promises";
import { bunEnv, bunExe, tmpdirSync } from "../../harness";
const tmpdir = tmpdirSync();
beforeAll(async () => {
setDefaultTimeout(1000 * 60 * 4);
await fs.rm(tmpdir, { recursive: true, force: true });
await fs.cp(import.meta.dir, tmpdir, { recursive: true, force: true });
});
test("expo export works (no ajv issues)", async () => {
console.log({ tmpdir });
let { exitCode } = Bun.spawnSync([bunExe(), "install"], {
stderr: "inherit",
stdout: "inherit",
cwd: tmpdir,
env: bunEnv,
});
expect(exitCode).toBe(0);
({ exitCode } = Bun.spawnSync([bunExe(), "run", "export", "-p", "web"], {
stdout: "inherit",
stderr: "inherit",
stdin: "inherit",
cwd: tmpdir,
env: {
...bunEnv,
PORT: "0",
},
}));
// just check exit code for now
expect(exitCode).toBe(0);
});