Skip to content

Commit 71b0516

Browse files
committed
style(engine): format the probe tests
1 parent 0cc6b1a commit 71b0516

2 files changed

Lines changed: 17 additions & 11 deletions

File tree

‎packages/engine/src/services/browserManager.test.ts‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,15 @@ describe("BeginFrame capability probe", () => {
8989
it("keeps trying a renderer that has not drawn its first surface yet, up to the probe deadline", async () => {
9090
const png = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]);
9191
let screenshotCalls = 0;
92-
const send = vi.fn().mockImplementation(async (_method: string, params?: { screenshot?: unknown }) => {
93-
if (!params?.screenshot) return {};
94-
screenshotCalls += 1;
95-
return screenshotCalls <= 25 ? { hasDamage: false } : { screenshotData: png.toString("base64") };
96-
});
92+
const send = vi
93+
.fn()
94+
.mockImplementation(async (_method: string, params?: { screenshot?: unknown }) => {
95+
if (!params?.screenshot) return {};
96+
screenshotCalls += 1;
97+
return screenshotCalls <= 25
98+
? { hasDamage: false }
99+
: { screenshotData: png.toString("base64") };
100+
});
97101
const browser = {
98102
newPage: vi.fn().mockResolvedValue({
99103
goto: vi.fn().mockResolvedValue(null),

‎packages/producer/src/services/distributed/renderChunkFallback.test.ts‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,11 @@ describe("a chunk whose workers launched in different capture modes", () => {
279279

280280
it("fails with a typed error instead of being retried or mixed into one output", async () => {
281281
expect(() => observedChunkCaptureMode(mixed)).toThrow(MixedCaptureModesError);
282-
expect(shouldRetryChunkCaptureWithScreenshot(new MixedCaptureModesError(["beginframe", "screenshot"]))).toBe(
283-
false,
284-
);
282+
expect(
283+
shouldRetryChunkCaptureWithScreenshot(
284+
new MixedCaptureModesError(["beginframe", "screenshot"]),
285+
),
286+
).toBe(false);
285287
let runs = 0;
286288
await expect(
287289
runCaptureWithScreenshotFallback({
@@ -297,9 +299,9 @@ describe("a chunk whose workers launched in different capture modes", () => {
297299
});
298300

299301
it("accepts one mode and still rejects a chunk with no workers or an unknown mode", () => {
300-
expect(observedChunkCaptureMode([{ captureMode: "beginframe" }, { captureMode: "beginframe" }])).toBe(
301-
"beginframe",
302-
);
302+
expect(
303+
observedChunkCaptureMode([{ captureMode: "beginframe" }, { captureMode: "beginframe" }]),
304+
).toBe("beginframe");
303305
expect(() => observedChunkCaptureMode([])).toThrow(/invalid mode/);
304306
expect(() => observedChunkCaptureMode([{ captureMode: "gpu" }])).toThrow(/invalid mode/);
305307
});

0 commit comments

Comments
 (0)