diff --git a/extensions/acpx/src/runtime.test.ts b/extensions/acpx/src/runtime.test.ts index 35444ba1ac9..5d410573ded 100644 --- a/extensions/acpx/src/runtime.test.ts +++ b/extensions/acpx/src/runtime.test.ts @@ -111,7 +111,11 @@ function makeLeaseStore() { function readFirstEnsureSessionInput(ensure: { mock: { calls: Array> }; }): Parameters[0] { - const input = ensure.mock.calls[0]?.[0]; + const [call] = ensure.mock.calls; + if (!call) { + throw new Error("Expected ensureSession to be called"); + } + const [input] = call; if (typeof input !== "object" || input === null) { throw new Error("Expected ensureSession to be called with an input object"); } diff --git a/extensions/acpx/src/service.test.ts b/extensions/acpx/src/service.test.ts index 022c7d7deab..37b5e61dd22 100644 --- a/extensions/acpx/src/service.test.ts +++ b/extensions/acpx/src/service.test.ts @@ -157,7 +157,11 @@ function createMockRuntime(overrides: Record = {}) { } function readFirstRuntimeFactoryInput(runtimeFactory: { mock: { calls: Array> } }) { - const input = runtimeFactory.mock.calls[0]?.[0]; + const [call] = runtimeFactory.mock.calls; + if (!call) { + throw new Error("Expected runtimeFactory to be called"); + } + const [input] = call; if (typeof input !== "object" || input === null) { throw new Error("Expected runtimeFactory to be called with an options object"); }