function useTestContext()
Clears the current global app context and initializes a test application context.
function useTestContext(
config?: (opts: TestContextOptions) => void,
): TestAppContext;
Parameters
- config — A TestContextOptions object, or a callback to set options
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`
});
