Skip to content

@vttforge/testing / index / withMockFoundry

Function: withMockFoundry() ​

withMockFoundry(options?): MockFoundry

Stand up the globals, run the callback, tear them down.

ts
const foundry = withMockFoundry();
registerMyModule();
expect(foundry.hooks.map((h) => h.event)).toContain('init');
foundry.restore();

Parameters ​

options? ​

MockFoundryOptions = {}

Returns ​

MockFoundry

MIT licensed.