From 5bb988796176bea26f9246b21e9945ba2b4ee704 Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Wed, 4 Nov 2026 13:43:27 +0100 Subject: [PATCH] test: load the OS command handler once before the launch tests, so a busy machine doesn't time the first one out --- lib/desktop/__tests__/os-commands.test.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/desktop/__tests__/os-commands.test.ts b/lib/desktop/__tests__/os-commands.test.ts index cd724ed85..d904c486c 100644 --- a/lib/desktop/__tests__/os-commands.test.ts +++ b/lib/desktop/__tests__/os-commands.test.ts @@ -1,4 +1,4 @@ -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest'; import type { BulwarkDesktopBridge, DesktopOsCommand } from '../types'; import type { NotificationActionRequest, NotificationActionStatus } from '@/lib/pwa-notify/page-actions'; @@ -44,6 +44,12 @@ async function run(command: DesktopOsCommand) { const text = (value: string) => new TextEncoder().encode(value); +// The handler pulls in much of the app the first time; load it once here, with room to spare, +// so the first test isn't the one that times out on a busy machine. +beforeAll(async () => { + await import('../os-commands'); +}, 60_000); + beforeEach(async () => { vi.clearAllMocks(); authenticated = true;