@rageltd/bun-test-utils
Version:
A collection of test utilities for Bun projects
19 lines • 673 B
TypeScript
/**
* Utilities for cleaning up mocks and restoring state in Bun tests.
*/
/**
* Sets up automatic cleanup for Bun tests.
*
* Registers an `afterEach` hook that restores all mocks after every test.
* Call this once per test file to ensure a clean state between tests.
*/
export declare function setupTestCleanup(): void;
/**
* Runs a test suite with automatic mock cleanup.
*
* Wrap your test suite in this function to ensure all module mocks are restored after all tests.
*
* @param testSuiteFn - Function containing your describe/it blocks.
*/
export declare function withMockCleanup(testSuiteFn: () => void): void;
//# sourceMappingURL=cleanupUtils.d.ts.map