Is it possible to "quickly fail" when running the rake test with minitest 5?

Is it possible to configure "rake test" to stop running tests as soon as it gets into a failure / exception?

My setup:

  • Rails 4.1
  • Minitest 5.3.4
  • Tapout (for formatting)

I would like to start the test package and immediately stop if the test failed - the default behavior is to continue to run all the tests, which in some cases are too big data (especially one small error causes a ton of tests to fail. )

I had a small little tweak with the old version of Minitest (4.x) and the Turn stone, following this point: ( Add a simple -fast failure to minitest / turn / minitest-rails ), but now I'm working on the new Rails 4.1, and Turn not compatible with Minitest 5 (yet).

Any thoughts?

+5
source share
2 answers

You can use this new stone with Rails 4.2 and Minitest 5.6.1: minitest-fail-fast

+1
source

If you use Rails 5, try rails test -f "exit quickly." This means interrupting the test run of the first failure or error if you run rails test -h

0
source

Source: https://habr.com/ru/post/910312/


All Articles