mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
19 lines
709 B
JavaScript
19 lines
709 B
JavaScript
|
|
/*
|
||
|
|
* Copyright (c) 2026 by Christian Kellner.
|
||
|
|
* Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause
|
||
|
|
*/
|
||
|
|
|
||
|
|
import { ensureValidBinary } from '../lib/services/ensureValidBinary.js';
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Vitest global setup — runs once in the main process before any workers start.
|
||
|
|
* Downloads and validates the CloakBrowser stealth Chromium binary.
|
||
|
|
* ensureValidBinary() also removes and re-downloads partial/corrupt installations
|
||
|
|
* so tests never fail with "Invalid file descriptor to ICU data received".
|
||
|
|
* Skipped in offline mode because the browser is fully mocked there.
|
||
|
|
*/
|
||
|
|
export async function setup() {
|
||
|
|
if (process.env.TEST_MODE === 'offline') return;
|
||
|
|
await ensureValidBinary();
|
||
|
|
}
|