steve77
steve77

Reputation: 243

Integration Tests in Elixir - how to filter out from Unit Tests

I want to separate out Integration tests from Unit Tests in Elixir. I found the Elixir mix documentation has a section on filters, and describes just what I want to do.

Then add the lines below into appdir/test/test_helper.exs

# Exclude all external tests from running  
ExUnit.configure exclude: [external: true]

Then how does one tag tests as "external"?

Upvotes: 10

Views: 1905

Answers (1)

José Valim
José Valim

Reputation: 51429

You just add @tag external: true (or the shortcut @tag :external) before the test definition (you can also use @moduletag to tag a whole test case).

Upvotes: 13

Related Questions