test(FN-000): resolve dashboard test noise

This commit is contained in:
Aron Prins
2026-05-05 22:25:29 +02:00
parent 55d8e87cc4
commit f85b124125
15 changed files with 113 additions and 298 deletions

View File

@@ -38,6 +38,24 @@ const fsPromises = requireFromHere("node:fs/promises") as FsPromisesModule;
const childProcess = requireFromHere("node:child_process") as ChildProcessModule;
const { mkdtempSync, mkdirSync, rmSync, realpathSync, existsSync } = fs;
function installWarningFilter(): void {
const warningState = globalThis as typeof globalThis & { __fusionTestWarningFilterInstalled?: boolean };
if (warningState.__fusionTestWarningFilterInstalled) return;
warningState.__fusionTestWarningFilterInstalled = true;
const originalEmitWarning = process.emitWarning.bind(process);
process.emitWarning = ((warning: string | Error, ...args: unknown[]) => {
const warningText = warning instanceof Error ? warning.message : warning;
const warningType = typeof args[0] === "string" ? args[0] : undefined;
if (warningType === "ExperimentalWarning" && warningText.includes("SQLite is an experimental feature")) {
return;
}
return originalEmitWarning(warning as string, ...(args as Parameters<typeof process.emitWarning> extends [any, ...infer Rest] ? Rest : never));
}) as typeof process.emitWarning;
}
installWarningFilter();
const TEST_HOME_PREFIX = "fn-test-home-";
const DEFAULT_TEST_SUBPROCESS_TIMEOUT_MS = Math.max(
1_000,