@dioramajs/effects/testing
Test helpers for effects: a GPU stand-in and probe().
On this page
import { box, codes, fakeRender } from '@dioramajs/effects/testing'Functions
box | A viewport box for happy-dom, which lays nothing out. |
codes | The codes of reported errors, the cause first. |
html | Adds an element with a viewport box. |
objects | Meshes and sprites in the render scene. |
probe | Mounts an effect on a fixture with the fake render, runs setup and two updates with pointer and scroll movement, and reports what it read and whether it rests. For the tests and the metadata of effect modules; needs a DOM such as happy-dom. |
run | Alternates tasks and frames until both settle; returns the frames drawn. |
start | Starts an app with the fake render, the effects preset and these entries, engine loaded. |
state | The element's `data-dio-state`. |
status | The status of an effect instance on an element. |
tick | Waits one task. |
viewport | happy-dom has no viewport size: the stage reads these. |
Constants
fakeRender | A `render` plugin without a GPU: a real three scene and a renderer that only counts. |
gpu | What the fake renderer drew, compiled and uploaded, and switches to make it fail. |
Interfaces
ProbeOptions | Options of `probe`. |
ProbeResult | What `probe` found out about an effect. |
World | An app started by `start` with its driver and what it reported. |