Skip to content

Commit

Permalink
test: fix check host (#829)
Browse files Browse the repository at this point in the history
  • Loading branch information
himself65 authored May 10, 2024
1 parent 6281fc8 commit 68a508f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/tests/vitest.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ globalThis.fetch = function fetch(...args: Parameters<typeof originalFetch>) {
url = url.toString();
}
}
const parsedUrl = new URL(url);
if (parsedUrl.hostname.includes("openai.com")) {
const { host } = new URL(url);
if (host.endsWith("openai.com")) {
// todo: mock api using https://mswjs.io
throw new Error(
"Make sure to return a mock response for OpenAI API requests in your test.",
Expand Down

0 comments on commit 68a508f

Please sign in to comment.