-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathvitest.setup.node.ts
More file actions
15 lines (14 loc) · 1006 Bytes
/
Copy pathvitest.setup.node.ts
File metadata and controls
15 lines (14 loc) · 1006 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Additional setup for the `node`-environment vitest projects that run the scripture converters,
// loaded alongside the shared `vitest.setup.ts`. Each such project wires this file in itself, so a
// `node`-environment project that never touches the converters does not load it — check that
// criterion rather than assuming every `node` project is covered.
//
// Those projects run the same converters the extension host does, and the converters need
// `DOMParser`/`XMLSerializer`, which a `node` environment has none of. Installing them here mirrors
// what `extension-host.ts` does at startup.
//
// Deliberately kept out of the shared setup file: the jsdom projects already have a real DOM, so
// putting it there would pull xmldom into all ~150 of their workers for nothing — and guarding it
// with a conditional `await import` would make that file a top-level-await module, which measurably
// destabilized timing-sensitive renderer tests.
import './src/node/polyfills/dom-globals.polyfill';