pixi-wheels

createTestWheel()

pixi-wheels


pixi-wheels / testing / createTestWheel

Function: createTestWheel()

function createTestWheel(options?: TestWheelOptions): TestWheelHandle;

Defined in: testing/testHarness.ts:109

Build a headless wheel on a fake ticker: no renderer, no textures, no DOM. The spin lifecycle, planner, pointer ticks and events all run for real; only the pixels are missing.

const h = createTestWheel({ sections: 8 });
const result = await h.spinAndLand({ section: 's3' });
expect(result.section.id).toBe('s3');
expect(h.wheel.sectionUnderPointer().id).toBe('s3');
h.destroy();

Parameters#

ParameterType
optionsTestWheelOptions

Returns#

TestWheelHandle