Skip to main content

vitest-environment-webgl-node

Type Aliases​

WebglNodeOptions​

type WebglNodeOptions = InitOptions & InstallDOMOptions;

Set under test.environmentOptions.webglNode in your Vitest config.

Variables​

default​

default: object;

The Vitest environment registered as webgl-node. Before each test file it installs node-webgl's window, document, HTMLCanvasElement, Image, requestAnimationFrame and WebGL* classes plus a file-reading fetch(), and it restores the original globals afterwards.

Type Declaration​

NameTypeDefault valueDescription
namestring'webgl-node'The name Vitest uses to select this environment: test.environment: 'webgl-node'.
viteEnvironment"ssr"'ssr'Runs test files through Vite's ssr environment, as Node code.
setup()(global, __namedParameters) => object-Installs the GL display and the DOM globals on the test file's global object.