Skip to content

Commit 0df50af

Browse files
committed
test(observability-map): pin the function-declaration walker branch
The fixture asserted the local and the member declaration forms but not the function declaration, so deleting that branch of the walker left the fixture test green and failed only the live-tree assertions the fixture exists to replace. Assert `helper` too, so each branch is pinned by its own name. Revert-confirmed: removing the branch now fails the fixture test.
1 parent 9ef6324 commit 0df50af

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

internal-packages/observability-map/fixtures/webappSymbols/app/declares.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// webappSymbols.test.ts's self-test tree. One name per declaration form, never two forms of the same
22
// name: a single `has` assertion cannot say which branch of the walker answered it, so a shared name
3-
// would let the member branch be deleted with the fixture test still green. `signJWT` is read and
4-
// declared nowhere, so a walker that collected references as declarations would find it.
3+
// would let a branch be deleted with the fixture test still green. `helper` covers the function
4+
// declaration, `createJWT` the local, `mintSessionToken` the member. `signJWT` is read and declared
5+
// nowhere, so a walker that collected references as declarations would find it.
56
export function helper(kind: string): boolean {
67
const createJWT = kind === "jwt";
78
return createJWT;

internal-packages/observability-map/src/webappSymbols.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,10 @@ describe("the names the tool matches on exist in the webapp", () => {
194194
// even as a local variable, and failed this suite on any pull request that did.
195195
it("finds a fixture name however it is declared, and rejects one that is only read", () => {
196196
const names = declaredNames([join(FIXTURES, "app")]);
197-
// A name per declaration form. Sharing one across both would pass on either branch alone, and
198-
// the member branch is the one with no other cover: several guards are reached through an
199-
// object, so deleting it fails only the live-tree assertions this fixture exists to replace.
197+
// A name per declaration form, so no branch of the walker is covered only by another's name:
198+
// deleting any one of the three fails here rather than in the live-tree assertions this fixture
199+
// exists to replace.
200+
expect(names.has("helper")).toBe(true);
200201
expect(names.has("createJWT")).toBe(true);
201202
expect(names.has("mintSessionToken")).toBe(true);
202203
expect(names.has("signJWT")).toBe(false);

0 commit comments

Comments
 (0)