Documentation

API Referencefunction

function useTestContext()

Clears the current global app context and initializes a test application context.

function useTestContext(
config?: (opts: TestContextOptions) => void,
): TestAppContext;

Parameters

Return value

The global app context, typed as TestAppContext.

Examples

describe("My scope", (scope) => {
  scope.beforeEach(() => {
    useTestContext({ path: "foo" });
  });

  // ... add some tests here, to use `app`
});