mirror of
https://github.com/bulwarkmail/webmail.git
synced 2026-11-05 00:14:18 +00:00
test: load the OS command handler once before the launch tests, so a busy machine doesn't time the first one out
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user