mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-12 21:53:00 -06:00
test: tighten extension helper assertions
This commit is contained in:
@@ -47,7 +47,6 @@ describe("duckduckgo web search provider", () => {
|
||||
expect(provider.requiresCredential).toBe(false);
|
||||
expect(provider.credentialPath).toBe("");
|
||||
const pluginEntry = applied.plugins?.entries?.duckduckgo;
|
||||
expect(pluginEntry).toBeDefined();
|
||||
if (!pluginEntry) {
|
||||
throw new Error("expected DuckDuckGo plugin entry");
|
||||
}
|
||||
|
||||
@@ -266,7 +266,6 @@ describe("inworldTTS", () => {
|
||||
expect(request.url).toBe("https://api.inworld.ai/tts/v1/voice:stream");
|
||||
expect(request.auditContext).toBe("inworld-tts");
|
||||
expect(request.policy).toEqual({ hostnameAllowlist: ["api.inworld.ai"] });
|
||||
expect(request.init).toBeDefined();
|
||||
if (!request.init) {
|
||||
throw new Error("expected Inworld TTS request init");
|
||||
}
|
||||
|
||||
@@ -54,7 +54,6 @@ function registerProvider() {
|
||||
);
|
||||
expect(registerProviderMock).toHaveBeenCalledTimes(1);
|
||||
const firstCall = registerProviderMock.mock.calls[0];
|
||||
expect(firstCall).toBeDefined();
|
||||
if (!firstCall) {
|
||||
throw new Error("expected Microsoft Foundry provider registration");
|
||||
}
|
||||
@@ -75,7 +74,6 @@ function requirePrepareRuntimeAuth(
|
||||
}
|
||||
|
||||
function requireRuntimeAuthResult(result: { apiKey?: string; baseUrl?: string } | undefined) {
|
||||
expect(result).toBeDefined();
|
||||
if (!result) {
|
||||
throw new Error("expected Microsoft Foundry runtime auth result");
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ function requireFirstMoonshotModel(provider: MoonshotProvider): MoonshotModel {
|
||||
}
|
||||
|
||||
function requireMoonshotCompat(model: MoonshotModel): NonNullable<MoonshotModel["compat"]> {
|
||||
expect(model.compat).toBeDefined();
|
||||
if (!model.compat) {
|
||||
throw new Error(`expected Moonshot model ${model.id} compat`);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,6 @@ type ReadabilityResult = Awaited<
|
||||
>;
|
||||
|
||||
function requireReadabilityResult(result: ReadabilityResult): NonNullable<ReadabilityResult> {
|
||||
expect(result).toBeDefined();
|
||||
if (!result) {
|
||||
throw new Error("expected readability extraction result");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user