Interface CheckpointSaverTestInitializer<CheckpointerT>

interface CheckpointSaverTestInitializer<CheckpointerT> {
    beforeAllTimeout?: number;
    checkpointerName: string;
    afterAll?(): void | Promise<void>;
    beforeAll?(): void | Promise<void>;
    createCheckpointer(): CheckpointerT | Promise<CheckpointerT>;
    destroyCheckpointer?(checkpointer): void | Promise<void>;
}

Type Parameters

Properties

beforeAllTimeout?: number

Optional timeout for beforeAll. Useful for test setups that might take a while to complete, e.g. due to needing to pull a docker container.

Default

10000
checkpointerName: string

The name of the checkpointer being tested. This will be used to identify the checkpointer in test output.

Methods

  • Called once after all tests are run. Use this to perform any infrastructure cleanup that your checkpointer may require, like tearing down docker containers, etc.

    Returns void | Promise<void>

  • Called once before any tests are run. Use this to perform any setup that your checkpoint checkpointer may require, like starting docker containers, etc.

    Returns void | Promise<void>

  • Called before each set of validations is run. The checkpointer returned will be used during test execution.

    Returns CheckpointerT | Promise<CheckpointerT>

    A new checkpointer, or promise that resolves to a new checkpointer.

  • Called after each set of validations is run. Use this to clean up any resources that your checkpointer may have been using. This should include cleaning up any state that the checkpointer wrote during the tests that just ran.

    Parameters

    Returns void | Promise<void>

    See

    BaseCheckpointSaver that was used during the test.