@sidequest/backend-test
Version:
@sidequest/backend-test is a test suite for backend implementations of Sidequest, a Node.js library for managing background jobs and distributed queues.
19 lines (16 loc) • 806 B
TypeScript
import { Backend } from '@sidequest/backend';
/**
* Sets up and runs a comprehensive test suite for a backend implementation.
*
* This function initializes the backend using the provided configuration and factory,
* and automatically registers a series of standardized test suites to validate
* backend behavior. It also manages backend setup and teardown for each test.
*
* **🚨 ATTENTION 🚨**: This function is intended for use in a testing environment only and with
* testing data. It will truncate the database after every test to ensure a clean state.
* It should not be used in production or with real data.
*
* @param backendFactory - A factory function that creates a backend instance.
*/
declare function testBackend(backendFactory: () => Backend): void;
export { testBackend };