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", () => {