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-4/

Test Result Filter CLI Tool

Build a command-line tool that helps developers run focused test sessions by filtering tests based on their previous execution results. The tool should maintain a test history and provide options to run only tests that failed in previous runs or only tests affected by recent changes.

Requirements

Core Functionality

  1. Test History Management: The tool should persist test execution results between runs. When tests complete, save which tests passed and which failed.

  2. Failure-Based Filtering: Provide a command-line option that runs only tests that failed in the most recent complete test run. This allows developers to focus on fixing failing tests without re-running everything.

  3. Change-Based Filtering: Provide a command-line option that runs only tests related to files that have changed since the last commit. This helps developers verify their recent changes without running the entire suite.

  4. Full Test Run Mode: Support running all tests without any filtering, which should also update the test history for future filtered runs.

Implementation Guidelines

  • Store test results in a JSON file (e.g., .test-history.json) that tracks:

    • Test file paths
    • Pass/fail status
    • Timestamp of last run
  • Use git to detect changed files (assume the project is in a git repository)

  • The tool should accept configuration via command-line flags:

    • --failures-only or -f: Run only previously failed tests
    • --changed-only or -c: Run only tests for changed files
    • No flags: Run all tests (default)
  • The tool should display which filtering mode is active before running tests

  • After test execution, update the stored history with the new results

Dependencies { .dependencies }

jest { .dependency }

Provides the test execution framework and programmatic test filtering capabilities.

Test Cases

Test 1: Run with Failure Filtering { .test }

Setup: Create a test history file indicating that math.test.js failed and utils.test.js passed in the previous run.

Action: Execute the tool with the --failures-only flag.

Expected: The tool should run only math.test.js and display a message indicating failure-based filtering is active.

Test 2: Run with Change-Based Filtering { .test }

Setup:

  • Ensure the project is a git repository with at least one commit
  • Modify calculator.js (but don't commit the change)
  • Assume calculator.test.js exists

Action: Execute the tool with the --changed-only flag.

Expected: The tool should identify that calculator.js has changed and run calculator.test.js. Display a message indicating change-based filtering is active.

Test 3: Full Test Run Updates History { .test }

Setup: Start with an empty or non-existent test history file.

Action: Run the tool without any flags to execute all tests.

Expected:

  • All tests in the project should run
  • A test history file should be created/updated with the results of this run
  • The history file should contain test paths and their pass/fail status

Version

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