Skip to content

Commit ed19e79

Browse files
committed
Throw error if mock not found
1 parent dafae52 commit ed19e79

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/vertexai/test-utils/mock-response.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ export function getMockResponseStreaming(
5858

5959
export function getMockResponse(filename: string): Partial<Response> {
6060
const fullText = mocksLookup[filename];
61+
if (!(filename in mocksLookup)) {
62+
throw Error(`Mock response file '${filename}' not found.`);
63+
}
6164
return {
6265
ok: true,
6366
json: () => Promise.resolve(JSON.parse(fullText))

0 commit comments

Comments
 (0)