Skip to content

@vttforge/testing / container / FoundryContainer

Interface: FoundryContainer ​

A running Foundry. Call stop() when the run is over.

Properties ​

baseUrl ​

readonly baseUrl: string

Absolute, because it is not always localhost.


network ​

readonly network: string | null

The Docker network Foundry joined, or null when the port is published.


packages ​

readonly packages: ReadonlyMap<string, FoundryManifest>

Manifests of everything installed, by package id.


system ​

readonly system: FoundryManifest

The manifest of the system the world runs on.

Methods ​

install() ​

install(source): FoundryManifest

Copy a built package into the container and hand back its manifest.

Foundry scans its packages directory once, at startup. A package installed into a running Foundry stays invisible until restart().

Parameters ​

source ​

FoundryPackageSource

Returns ​

FoundryManifest


logs() ​

logs(tail?): string

The container's last log lines.

Parameters ​

tail? ​

number

Returns ​

string


restart() ​

restart(): Promise<void>

Stop and start, clearing the lock that a stop does not always clear.

Resolves once the world is joinable, not merely once the server answers. Those are two different moments, and a package installed between them is not loaded yet.

Returns ​

Promise<void>


stop() ​

stop(): void

Remove the container. The volume survives, so the next run starts faster.

Returns ​

void

MIT licensed.