From 8543ba40ded792f647a5efba85fbfbb822c783ff Mon Sep 17 00:00:00 2001 From: Shakker Date: Fri, 8 May 2026 18:53:29 +0100 Subject: [PATCH] test: tighten huggingface provider assertion --- extensions/huggingface/index.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/extensions/huggingface/index.test.ts b/extensions/huggingface/index.test.ts index c6c89a8ad2d..d4cb715d3cc 100644 --- a/extensions/huggingface/index.test.ts +++ b/extensions/huggingface/index.test.ts @@ -40,7 +40,12 @@ function registerProviderWithPluginConfig(pluginConfig: Record) ); expect(registerProviderMock).toHaveBeenCalledTimes(1); - return registerProviderMock.mock.calls[0]?.[0]; + const firstCall = registerProviderMock.mock.calls.at(0); + expect(firstCall).toBeDefined(); + if (!firstCall) { + throw new Error("expected huggingface provider registration"); + } + return firstCall[0]; } describe("huggingface plugin", () => {