Skip to main content

Function: cleanup()

cleanup(): Promise<void>

Defined in: render.tsx:145

Cleans up the rendered component tree.

Unmounts all rendered components and resets the testing environment. Call this in afterEach to ensure tests don't affect each other.

Returns

Promise<void>

Example

import { render, cleanup } from "@gtkx/testing";

afterEach(async () => {
await cleanup();
});

test("my test", async () => {
await render(<MyComponent />);
// ...
});