mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-23 06:10:02 +08:00
- Enforce oxlint and oxfmt for owned JavaScript and TypeScript with independent CI checks. - Preserve compiler import boundaries and protected fixtures while cleaning up lint findings. - Standardize source formatting and validate import, fixture, and embedded-source protections.
50 lines
1.4 KiB
TypeScript
50 lines
1.4 KiB
TypeScript
import { expect, test } from "vitest";
|
|
import { sandboxHostSchedule, sandboxLaneEnv } from "../../scripts/sandbox-platform.mjs";
|
|
|
|
const files = ["native-a.test.ts", "native-b.test.ts"];
|
|
|
|
test("Darwin runs native files and kqueue contracts locally", () => {
|
|
expect(sandboxHostSchedule("darwin", files)).toEqual({
|
|
darwinContracts: true,
|
|
localArtifactContracts: true,
|
|
localInvariantFiles: files,
|
|
remoteArtifactContracts: false,
|
|
remoteInvariantFiles: [],
|
|
});
|
|
});
|
|
|
|
test("Linux runs its supported native files locally without Darwin contracts", () => {
|
|
expect(sandboxHostSchedule("linux", files)).toEqual({
|
|
darwinContracts: false,
|
|
localArtifactContracts: true,
|
|
localInvariantFiles: files,
|
|
remoteArtifactContracts: false,
|
|
remoteInvariantFiles: [],
|
|
});
|
|
});
|
|
|
|
test("other hosts retain native-file coverage in Linux Sandboxes", () => {
|
|
expect(sandboxHostSchedule("win32", files)).toEqual({
|
|
darwinContracts: false,
|
|
localArtifactContracts: false,
|
|
localInvariantFiles: [],
|
|
remoteArtifactContracts: true,
|
|
remoteInvariantFiles: files,
|
|
});
|
|
});
|
|
|
|
test("lane environments override inherited sanitizer and scheduler settings", () => {
|
|
expect(sandboxLaneEnv("plain")).toEqual({
|
|
CI: "1",
|
|
SCRIPTC_PORTABLE_ONLY: "",
|
|
SCRIPTC_SAN: "",
|
|
SCRIPTC_TEST_SHARD: "",
|
|
});
|
|
expect(sandboxLaneEnv("san")).toEqual({
|
|
CI: "1",
|
|
SCRIPTC_PORTABLE_ONLY: "",
|
|
SCRIPTC_SAN: "1",
|
|
SCRIPTC_TEST_SHARD: "",
|
|
});
|
|
});
|