rtfeldman / rtfeldman/node-test-runner

Debug on fail

Open
#476 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
140
Forks
83
Avg merge
8h 25m
Merged PRs (30d)
5

Description

A pretty neat feature would be a new flag, that would run the test as usual. However, when there would be a failure, it would:

  1. shrink it as usual
  2. pause execution
  3. print the failure message
  4. open an elm repl
  5. reexecute the test in the repl (with the shrunk data)

This would drop you nicely into the repl with everything going on in the test in scope. This comes from a workflow, where one would write a complex fuzz test, run it for say 10000 iterations. This can find some fairly obscure bugs, so one would like to be able to inspect the intermediate data structures, and even run some experiments in the console, however this can be hard to achieve with just the test output and time consuming to set up.

A nice further refinement would be that one could enter this mode after a run in watch mode by pressing say the D key, which would be a nice way to combine this with watch mode.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests; begin by tracing the test-runner flag handling and its watch-mode interaction. Implement the described failure flow around shrinking, pausing, printing the failure, and opening an Elm REPL with the shrunk data, then verify it with focused runner tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.