import { describe, it } from "node:test"; import { outsideRoots, underRoots } from "../../../tools/core/filters/scope.filter.ts"; import assert from "node:assert/strict"; const PATHS = ["tools/core/a.ts", "tools/rules/b.ts", "config/c.ts", "tools/core/d.ts"]; describe("underRoots and outsideRoots", () => { it("splits the paths by whether any root prefixes them, keeping each path once and in order", () => { const roots = ["tools/core/", "tools/"]; assert.deepEqual(underRoots(PATHS, roots), ["tools/core/a.ts", "tools/rules/b.ts", "tools/core/d.ts"]); assert.deepEqual(outsideRoots(PATHS, roots), ["config/c.ts"]); }); it("places every path outside when no root is given", () => { assert.deepEqual(underRoots(PATHS, []), []); assert.deepEqual(outsideRoots(PATHS, []), PATHS); }); });