All checks were successful
CI / Build, Test & Publish (pull_request) Successful in 4m0s
19 lines
661 B
TypeScript
19 lines
661 B
TypeScript
import { describe, expect, it } from "bun:test";
|
|
import { readdirSync, readFileSync } from "node:fs";
|
|
import { join } from "node:path";
|
|
|
|
// The scheduler sits below kitchen: it must never import it (nor the parser),
|
|
// directly or through a relative path out of the package.
|
|
describe("package boundaries", () => {
|
|
it("imports nothing from the packages that depend on it", () => {
|
|
const dir = join(import.meta.dir, "../src");
|
|
const offenders = readdirSync(dir)
|
|
.filter((f) => f.endsWith(".ts"))
|
|
.filter((f) =>
|
|
/from\s+["'](@gram-lang\/|\.\.\/)/.test(
|
|
readFileSync(join(dir, f), "utf8"),
|
|
),
|
|
);
|
|
expect(offenders).toEqual([]);
|
|
});
|
|
});
|