From the command line, at the moment, yes. Right now, options can only be set in code (except for CI
). I can definitely see the use for it though and would be happy to explore a more general env var that could set arbitrary options. Something like MNEME_OPTS="[action: :reject]" mix test
.
Why not add mix mneme.test
similar to watch that accepts extra arguments? Not sure if it’s worth the trouble though, but sometimes I like to run some tests to see output only even when they fail.
Or just add it to mneme.watch
. That would actually solve my use case.
I’m refactoring, the current assertion is correct, but I want to check what my current output shows
Let’s go ahead and add mix mneme.test
and then mix mneme.watch
will use that under the hood instead of mix test
so that it supports the same options.
I had previously resisted adding a mix mneme.test
because I wanted the “getting started” story to be as simple as possible and I didn’t, at the time, want Mneme to have any custom Mix tasks, but now that we do have Mix tasks, that argument falls away. Also, adding it doesn’t prevent people from using mix test
– it’ll just be an option if you want to configure Mneme using command line flags.
I opened an issue for it!
Finally got around to recording a short demo using mix mneme.watch
. This is a (simplified) example of how I wrote the Igniter installer for Mneme itself:
v0.10.0 is now available
This release adds mix mneme.test
, a basic wrapper around mix test
that allows Mneme’s configuration options to be passed at the command line in addition to all the options normally accepted when running tests. Additionally, mix mneme.watch
now wraps mneme.test
and therefore takes the same options.
I recommend you add :"mneme.test"
to your :preferred_cli_env
in mix.exs
:
def project do
[
...
preferred_cli_env: [
"mneme.test": :test,
"mneme.watch": :test
],
...
]
end
You can also simply run MIX_ENV=test mix mneme.install
to update your setup.