Files
scriptc/tests/harness/effect.test.ts
Chris Tate c08ab955ae Enforce linting and consistent source formatting
- 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.
2026-10-05 17:51:24 -05:00

29 lines
918 B
TypeScript

import { globSync } from "node:fs";
import { basename, join } from "node:path";
import { test } from "vitest";
import { balancedShardSelect } from "./shard.js";
import { checkEffectFixture } from "./effect-runner.js";
import fixtureCosts from "./effect-costs.json";
const sanitize = process.env["SCRIPTC_SAN"] === "1";
const fixtures = globSync(join(import.meta.dirname, "../fixtures/effect/*.ts")).sort();
const costs: Record<string, number> = fixtureCosts;
const cases = balancedShardSelect(
fixtures,
(file) => basename(file),
(file) => costs[basename(file)] ?? 120,
);
const concurrent = process.env["SCRIPTC_EFFECT_TEST_CONCURRENCY"] === "2";
test.for(cases)(
"published Effect %s matches Node statically",
{ concurrent, timeout: 600_000 },
async (entry) => {
await checkEffectFixture(
entry,
["effect", "fast-check", "pure-rand"],
sanitize ? "dev" : "release",
);
},
);