Skip to content

Commit

Permalink
Fix test case for user exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettgu10 committed Mar 12, 2024
1 parent d56674e commit 7f2d615
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fixtures/dev-env/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ describe("startDevWorker: ProxyController", () => {
});

res = await run.worker.fetch("http://dummy");
await expect(res.text()).resolves.toBe("Error: Boom!");
await expect(res.text()).resolves.toMatch(/^Error: Boom!/);

await new Promise((r) => setTimeout(r, 100)); // allow some time for the error to be logged (TODO: replace with retry/waitUntil helper)
expect(consoleErrorSpy).toBeCalledWith(
Expand All @@ -372,7 +372,7 @@ describe("startDevWorker: ProxyController", () => {
});

res = await run.worker.fetch("http://dummy");
await expect(res.text()).resolves.toBe("Error: Boom 2!");
await expect(res.text()).resolves.toMatch(/^Error: Boom 2!/);

await new Promise((r) => setTimeout(r, 100)); // allow some time for the error to be logged (TODO: replace with retry/waitUntil helper)
expect(consoleErrorSpy).toBeCalledWith(
Expand Down

0 comments on commit 7f2d615

Please sign in to comment.