tessl install tessl/npm-jest-circus@29.7.0The next-gen flux-based test runner for Jest that provides test framework globals and event-driven test execution
Agent Success
Agent success rate when using this tile
82%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.91x
Baseline
Agent success rate without this tile
43%
A utility module that provides test helper functions for managing and cleaning up mock states in test suites. The module should help developers properly reset test mocks between test cases to prevent test pollution.
@generates
/**
* Clears the call history of a mock function without affecting its implementation.
*
* @param {Function} mockFn - A Jest mock function whose call history should be cleared.
*/
function clearMockHistory(mockFn) {
// IMPLEMENTATION HERE
}
/**
* Completely resets a mock function, clearing its call history and removing
* any custom implementation or return values.
*
* @param {Function} mockFn - A Jest mock function to reset completely.
*/
function resetMock(mockFn) {
// IMPLEMENTATION HERE
}
/**
* Restores a spy to its original implementation.
*
* @param {Function} spyFn - A Jest spy function to restore.
*/
function restoreSpy(spyFn) {
// IMPLEMENTATION HERE
}
/**
* Clears call history from multiple mock functions.
*
* @param {Function[]} mockFns - Array of Jest mock functions.
*/
function clearMultipleMocks(mockFns) {
// IMPLEMENTATION HERE
}
/**
* Resets multiple mock functions completely.
*
* @param {Function[]} mockFns - Array of Jest mock functions.
*/
function resetMultipleMocks(mockFns) {
// IMPLEMENTATION HERE
}
module.exports = {
clearMockHistory,
resetMock,
restoreSpy,
clearMultipleMocks,
resetMultipleMocks,
};Provides test framework globals and mock functionality.
@satisfied-by