test(javascript): align semantic fixtures with runtime context

This commit is contained in:
morluto committed 2026-10-24 08:22:13 +08:00
1 parent c3ad8fc024
commit 59553c76be
4 files changed
+31 -12

No files matched your search

@@ -168,7 +168,14 @@ it("retains a finite shared callable alias graph", () => {
index.bindings,
"direct-call",
)(call.callee, call);
const declaration = parsed.program.body[0];
if (!t.isVariableDeclaration(declaration))
throw new Error("Expected root callable declaration");
const callable = declaration.declarations[0]?.init;
if (!t.isArrowFunctionExpression(callable))
throw new Error("Expected root arrow callable");
expect(result).toEqual({
callables: new Set([callable]),
references: [
{
node: expect.objectContaining({ type: "Identifier", name: "module" }),