Ctrl + K
DocumentationLog inGet started

tessl/npm-jest-circus

tessl install tessl/npm-jest-circus@29.7.0

The 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%

task.mdevals/scenario-6/

Test Utilities Manager

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.

Capabilities

Mock State Cleanup

  • Clears all call history from a provided mock function without removing its implementation @test
  • Completely resets a mock function by clearing its history and removing any custom implementation @test
  • Restores a spy to its original implementation while keeping the spy functional @test

Batch Mock Management

  • Clears call history from multiple mock functions at once @test
  • Resets multiple mock functions at once, removing all implementations @test

Implementation

@generates

API

/**
 * 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,
};

Dependencies { .dependencies }

jest-circus { .dependency }

Provides test framework globals and mock functionality.

@satisfied-by

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/jest-circus@29.7.x
tile.json