

























@@ -118,11 +118,16 @@ function requireActionPayload(
118118}
119119120120function requireLoadWebMediaOptions(): Record<string, unknown> {
121-const call = vi.mocked(loadWebMedia).mock.calls[0];
121+const call = requireLoadWebMediaCall();
122+return requireRecord(call[1]);
123+}
124+125+function requireLoadWebMediaCall(): readonly unknown[] {
126+const call = vi.mocked(loadWebMedia).mock.calls.at(0);
122127if (!call) {
123128throw new Error("Expected loadWebMedia to be called");
124129}
125-return requireRecord(call[1]);
130+return call;
126131}
127132128133async function expectSandboxMediaRewrite(params: {
@@ -525,9 +530,9 @@ describe("runMessageAction media behavior", () => {
525530sandboxRoot: sandboxDir,
526531});
527532528-const call = vi.mocked(loadWebMedia).mock.calls[0];
529-expect(call?.[0], testCase.name).toBe(path.join(sandboxDir, testCase.expectedPath));
530-expect(requireRecord(call?.[1]).sandboxValidated, testCase.name).toBe(true);
533+const call = requireLoadWebMediaCall();
534+expect(call[0], testCase.name).toBe(path.join(sandboxDir, testCase.expectedPath));
535+expect(requireRecord(call[1]).sandboxValidated, testCase.name).toBe(true);
531536});
532537}
533538此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。