From e44bee708d97a4e4eea4c73e53c2ece9fa58701b Mon Sep 17 00:00:00 2001 From: Christian Bager Bach Houmann Date: Mon, 12 Oct 2026 19:31:22 +0200 Subject: [PATCH] test: load ICU data once before Vitest workers start --- tests/vitest-global-setup.ts | 7 +++++++ vitest.config.mts | 1 + 2 files changed, 8 insertions(+) create mode 100644 tests/vitest-global-setup.ts diff --git a/tests/vitest-global-setup.ts b/tests/vitest-global-setup.ts new file mode 100644 index 000000000..1285e9ccf --- /dev/null +++ b/tests/vitest-global-setup.ts @@ -0,0 +1,7 @@ +// The first date format on a machine pages Node's ICU data in from disk, and +// every later process shares those pages. On Windows CI that read can stall a +// test past its timeout while the first wave of workers loads, so pay it here, +// once, before any worker starts. +export default function warmIcuData(): void { + new Date(0).toLocaleDateString(); +} diff --git a/vitest.config.mts b/vitest.config.mts index 309ed2553..c9a9f28a8 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -46,6 +46,7 @@ export default defineConfig({ // Files that need a DOM or Svelte code opt in with `// @vitest-environment jsdom`. // jsdom setup per file is the suite's largest cost, so it is not the default. setupFiles: ["./tests/vitest-setup.ts"], + globalSetup: ["./tests/vitest-global-setup.ts"], coverage: { provider: "v8", include: ["src/**/*.ts"],