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

This commit is contained in:
morluto committed 2026-10-20 22:05:55 +08:00
1 parent d43d3568f2
commit fa36657251
2 files changed
+126 -386

No files matched your search

@@ -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];",