Skip to content

Commit 0eb50f9

Browse files
committed
test: guard module loader cache mock calls
1 parent e657bff commit 0eb50f9

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/plugins/plugin-module-loader-cache.test.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,16 @@ describe("getCachedPluginModuleLoader", () => {
396396
})("/repo/extensions/demo-b/index.ts");
397397

398398
const marker = Symbol.for("pathe:normalizedAlias");
399-
const firstAlias = (createJiti.mock.calls[0]?.[1] as { alias?: Record<string, string> }).alias;
400-
const secondAlias = (createJiti.mock.calls[1]?.[1] as { alias?: Record<string, string> }).alias;
399+
const firstAlias = (
400+
callArg(createJiti, 0, 1, "first jiti options") as {
401+
alias?: Record<string, string>;
402+
}
403+
).alias;
404+
const secondAlias = (
405+
callArg(createJiti, 1, 1, "second jiti options") as {
406+
alias?: Record<string, string>;
407+
}
408+
).alias;
401409

402410
expect(createJiti).toHaveBeenCalledTimes(2);
403411
expect(cache.size).toBe(2);

0 commit comments

Comments
 (0)