diff --git a/workbench-ui/src/test/setup.ts b/workbench-ui/src/test/setup.ts index d483af4b..7b5e22e9 100644 --- a/workbench-ui/src/test/setup.ts +++ b/workbench-ui/src/test/setup.ts @@ -1,5 +1,14 @@ import "@testing-library/jest-dom/vitest"; +// Node-environment test files (doctrine/*) have no global navigator on +// Node 20 (Node >=21 added one — which is why this only fails in CI). +if (typeof globalThis.navigator === "undefined") { + Object.defineProperty(globalThis, "navigator", { + configurable: true, + value: {}, + }); +} + Object.defineProperty(navigator, "clipboard", { configurable: true, value: {