Skip to content

@vttforge/testing / index / createMockConfig

Function: createMockConfig() ​

createMockConfig(overrides?): FoundryConfig

A complete CONFIG for a test.

FoundryConfig names every document entry Foundry ships, because a live Foundry has them all. A test that only cares about one entry still has to hand over a whole object, so this builds the empty one and merges what the test gives it.

ts
globalThis.CONFIG = createMockConfig({
  Combat: { ...createMockConfig().Combat, initiative: { formula: '1d20' } },
});

Parameters ​

overrides? ​

Partial<FoundryConfig> = {}

Returns ​

FoundryConfig

MIT licensed.