Created
April 28, 2018 12:12
-
-
Save NunoAlexandre/7f4a2cd24519f25d42ac3a38a9f4e527 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Command | |
``` bash | |
stack test --fast --test-arguments '-m "<identifier>"' | |
``` | |
The `<identifier>` can be pretty much anything: | |
- Part of / a module's name | |
- A `describe` / `it` description | |
#### Example | |
Say you have the following `Spec`: | |
``` haskell | |
module MyApp.Foo.BarSpec (spec) where | |
spec :: Spec | |
spec = parallel $ do | |
describe "baz" $ do | |
it "qux" | |
``` | |
- To run all the unit tests under `Foo`, run: | |
``` bash | |
stack test --fast --test-arguments '-m "Foo"' | |
``` | |
- To run all the unit tests in the `BarSpec` module, run: | |
``` bash | |
stack test --fast --test-arguments '-m "Bar"' | |
``` | |
Note it's just `Bar`, not `BarSpec`. | |
- To run the subset of unit tests under `baz`, run: | |
``` bash | |
stack test --fast --test-arguments '-m "baz"' | |
``` | |
- To run a specific single unit test, run: | |
``` bash | |
stack test --fast --test-arguments '-m "qux"' | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment