Skip to content

@vttforge/testing / registerBatch

Function: registerBatch()

registerBatch(id, fn, options?): void

Register a batch once Quench is ready.

Safe to call at module scope: it waits for the hook rather than assuming Quench has loaded, which is the mistake that makes a batch silently never appear.

ts
registerBatch('my-module.sheets', ({ describe, it, assert }) => {
  describe('character sheet', () => {
    it('renders', async () => {
      const actor = await Actor.create({ name: 'T', type: 'character' });
      await actor.sheet.render(true);
      assert.ok(actor.sheet.rendered);
      await actor.delete();
    });
  });
});

Parameters

id

string

fn

(context) => void

options?

BatchOptions = {}

Returns

void

MIT licensed.