Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Select which test to run with Hspec and stack

I've written a series of test, using the automatic spec discovery feature of Hspec. I'm also using stack as my build tool.

My test directory has the the Spec.hs file, along with the test files for the different modules of my application (e.g. Module0Spec.hs, Module1Spec.hs).

Now, when I start writing a new test module, or when I want to re-run a failed test after code changes, I'd like to be able to run only a given test module.

Is there any way in which either stack or Hspec allow to do this?

like image 629
Damian Nadales Avatar asked Sep 07 '16 08:09

Damian Nadales


1 Answers

I found the answer here. I was trying with --, however I needed to use --test-arguments:

stack test --test-arguments "-m "Module0""
like image 55
Damian Nadales Avatar answered Oct 21 '22 20:10

Damian Nadales