Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

test: skip export scan without new candidates (#9958)

[._.]/ Adam Eivy70d9a0620dda
diff --git a/server/deadExports.test.js b/server/deadExports.test.js
index ced164dbf9..59fdbbc43f 100644
--- a/server/deadExports.test.js
+++ b/server/deadExports.test.js
@@ -97,9 +97,23 @@ describe('server dead exports', () => {
expect([...addedExportNamesFromDiff(diff)]).toEqual(['brandNew']);
});
+ it('reports a newly introduced orphan export against candidate names', () => {
+ const candidates = addedExportNamesFromDiff('+export function orphan() {');
+ const files = new Map([
+ ['server/services/example.js', 'export function orphan() {}\n'],
+ ['server/routes/example.js', 'export function unrelated() {}\n'],
+ ]);
+
+ expect(deadExports(files, candidates)).toEqual([
+ { file: 'server/services/example.js', name: 'orphan' },
+ ]);
+ });
+
it('keeps newly added server function exports reachable', () => {
// Existing test-only and undocumented public exports predate this guard.
// Gate additions while that legacy inventory is reduced separately.
- expect(deadExports(trackedFiles(), addedExportNames())).toEqual([]);
+ const candidates = addedExportNames();
+ const orphans = candidates.size > 0 ? deadExports(trackedFiles(), candidates) : [];
+ expect(orphans).toEqual([]);
});
});