Skip to content

Commit 7805744

Browse files
committed
test(layering): read router boundary packages from tracked manifests
The positive control enumerated package directories from the working tree, so an untracked scratch package could fail it. It now reads the tracked manifests, as the other layering scans do, and also covers the apple-runner and tv-cdp targets the policy forbids.
1 parent 0514b3e commit 7805744

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎scripts/layering/snapshot-router-boundary.test.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { test } from 'node:test';
55
import { ARCHITECTURE_OWNERSHIP, matchesDeclaredRoot } from './architecture-ownership.ts';
66
import { resolveImportEdges } from './model.ts';
77
import { workspaceSpecifierTargets } from './package-boundaries.ts';
8-
import { listTrackedTypeScriptFiles } from './tracked-sources.ts';
8+
import { listTrackedPackageManifests, listTrackedTypeScriptFiles } from './tracked-sources.ts';
99

1010
const repoRoot = path.resolve(import.meta.dirname, '../..');
1111

@@ -47,9 +47,9 @@ test('the snapshot router imports no platform or provider package', () => {
4747
});
4848

4949
test('every platform and provider package is a forbidden router target', () => {
50-
const packages = fs
51-
.readdirSync(path.join(repoRoot, 'packages'))
52-
.filter((name) => /^(platform|provider)-/.test(name))
50+
const packages = listTrackedPackageManifests(repoRoot)
51+
.map((manifest) => path.posix.dirname(manifest).slice('packages/'.length))
52+
.filter((name) => /^(?:platform|provider)-|^(?:apple-runner|tv-cdp)$/.test(name))
5353
.map((name) => `packages/${name}/`);
5454

5555
assert.ok(packages.length > 0, 'expected platform and provider packages');

0 commit comments

Comments
 (0)