Skip to content

@vttforge/testing / container / startFoundryContainer

Function: startFoundryContainer() ​

startFoundryContainer(options?): Promise<FoundryContainer>

Start Foundry, install the packages, launch a world on them, and wait for the join screen.

ts
const foundry = await startFoundryContainer({
  acceptLicense: true,
  name: 'my-module-e2e',
  packages: [
    { kind: 'system', id: 'some-system', from: 'test/fixtures/system' },
    { kind: 'module', id: 'my-module', from: 'dist' },
  ],
});
try {
  // drive foundry.baseUrl with a browser
} finally {
  foundry.stop();
}

Needs docker on the PATH and FOUNDRY_LICENSE_KEY, FOUNDRY_USERNAME and FOUNDRY_PASSWORD in the environment. First run downloads Foundry, which takes a couple of minutes; later runs reuse the volume.

Parameters ​

options? ​

FoundryContainerOptions = {}

Returns ​

Promise<FoundryContainer>

MIT licensed.