fix(web-next): correct idempotency test to use bindAll not bindAllProduction
bindAllProduction has no idempotency guard — the promise cache lives in bindAll. Test was calling the wrong function, causing the spy to fire twice.
This commit is contained in:
@@ -69,12 +69,13 @@ describe("bindAllProduction", () => {
|
||||
expect(bindProductionMedia).toHaveBeenCalledOnce();
|
||||
});
|
||||
|
||||
it("is idempotent — second call does not re-bind", async () => {
|
||||
const { bindAllProduction } = await import("./bind-production");
|
||||
it("is idempotent via bindAll — second call does not re-bind", async () => {
|
||||
vi.stubEnv("NODE_ENV", "production");
|
||||
const { bindAll } = await import("./bind-production");
|
||||
const { bindProductionBlog } =
|
||||
await import("@repo/blog/di/bind-production");
|
||||
await bindAllProduction();
|
||||
await bindAllProduction();
|
||||
await bindAll();
|
||||
await bindAll();
|
||||
expect(bindProductionBlog).toHaveBeenCalledOnce();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user