Reputation: 15216
I have a test suite which uses wallaby
library which needs a heavyweight webpack build for usage. The problem is that I this webpack build is too heavy to use it before only model test, for example.
So, I decided about this feature:
@tag :wallaby
Is it the best design? How can I implement it?
Upvotes: 0
Views: 218
Reputation: 9299
According to "Test Pyramid" you shouldn't have many UI tests and you should run them rarely, because they are slow and expensive.
One approach would be to exclude the wallaby
tag from your unit tests by adding this to your test_helpers
:
ExUnit.configure exclude: [:wallaby]
Now running mix test
won't run any UI tests until you run it with --include
:
mix test --include wallaby
This approach is better than hook before wallaby
tag, because it is explicit and developer won't be surprised by long running build and integration tests.
It might be also good idea to add mix alias in mix.exs
which starts the webpack build and runs the wallaby test. It will be single command that can be used in CI.
Upvotes: 0