test(ci): deduplicate browser lifecycle fixtures and cover export ordering

This commit is contained in:
morluto
2026-10-20 22:05:55 +08:00
parent d43d3568f2
commit fa36657251
2 changed files with 126 additions and 386 deletions
@@ -40,6 +40,23 @@ const indexed = (source: string) => {
};
};
it("orders exported callable initializers within their enclosing declaration", () => {
const ir = analyzeJavaScriptSemantics(`
function original() {}
export const first = original, second = first;
second();
export const before = later, later = original;
before();
`);
const original = ir.callables.find(({ name }) => name === "original");
if (original === undefined) throw new Error("Missing original callable");
expect(ir.callSites[0]).toMatchObject({
resolution: "exact",
calleeCallableIds: [original.callableId],
});
expect(ir.callSites[1]?.resolution).not.toBe("exact");
});
it.each([
"if(flag)({make}={make:replacement});",
"if(flag)[make]=[replacement];",