testHudClient beta
Function of @v12-engine/client/testing
ts
export declare function testHudClient(members?: Omit<Partial<HudClient>, 'view'> & {
view?: Partial<GameView>;
}): TestHudClient;A HudClient for a test of a HUD part, with no page and no renderer: a real createUi() model, a real HudEvents told from it, empty keys, the given view (visuals left empty when not given), and hands (controller) that write down what they are asked to do (done) and answer nothing, and portraits with no models (the faces show their pictures). Whatever else a test needs of the client is passed in members, and replaces the stand-in
ts
// testHudClient, of `@v12-engine/client/testing`
const client = testHudClient({ view: { hud: { hide: ['clock'] } } })
client.ui.setIdleWorkers(3)
client.controller.selectIdleWorker()
expect(client.done).toEqual([{ what: 'selectIdleWorker', args: [] }])