test: tighten huggingface provider assertion

This commit is contained in:
Shakker
2026-05-08 18:53:29 +01:00
parent 7c86f7434d
commit 8543ba40de

View File

@@ -40,7 +40,12 @@ function registerProviderWithPluginConfig(pluginConfig: Record<string, unknown>)
);
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", () => {