@vttforge/testing / index / MockFoundry
Interface: MockFoundry ​
Properties ​
enrichers ​
readonlyenrichers: readonlyRecordedEnricher[]
Every text enricher registered, in order.
id is namespaced, which is what stops a common name from colliding with another package, and what makes onRender fire at all.
hooks ​
readonlyhooks: readonlyRecordedHook[]
Every Hooks.on and Hooks.once, in order.
notifications ​
readonlynotifications: readonlyobject[]
Every notification raised, by severity.
settings ​
readonlysettings: readonlyRecordedSetting[]
Every game.settings.register, in order.
sheets ​
readonlysheets: readonlyRecordedSheet[]
Every sheet registered, in order.
key is the thing worth asserting: Foundry saves it on each document using the sheet, so a test that pins the key is a test that the reader's choice survives your next build.
Methods ​
callHook() ​
callHook(
event, ...args):unknown[]
Fire a hook the way Foundry would, for the listeners registered so far.
Parameters ​
event ​
string
args ​
...unknown[]
Returns ​
unknown[]
getSetting() ​
getSetting(
namespace,key):unknown
Read back a registered setting's current value.
Parameters ​
namespace ​
string
key ​
string
Returns ​
unknown
restore() ​
restore():
void
Put every global back the way it was.
Returns ​
void