Skip to content

Commit c551b8d

Browse files
committed
fix flaky timeout test
1 parent b430413 commit c551b8d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/playwright.test.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assert, layer } from "@effect/vitest";
1+
import { assert, expect, layer } from "@effect/vitest";
22
import { Effect } from "effect";
33
import { Playwright } from "effect-playwright";
44
import { chromium } from "playwright-core";
@@ -59,16 +59,14 @@ layer(Playwright.layer)("Playwright", (it) => {
5959
const result = yield* playwright
6060
.launchScoped(chromium, {
6161
timeout: 1,
62-
executablePath: "sleep",
63-
args: ["10"],
62+
executablePath: "/bin/cat",
6463
})
6564
.pipe(Effect.flip);
6665
assert(
6766
result._tag === "PlaywrightError",
6867
"Expected failure with timeout 0",
6968
);
70-
71-
assert(result.reason === "Timeout", "Expected timeout");
69+
expect(result.reason).toBe("Timeout");
7270
}),
7371
);
7472
});

0 commit comments

Comments
 (0)