View Source mix mneme.install (Mneme v0.10.0)

Sets up Mneme in your project.

Running this command will automatically patch the following:

  • mix.exs - Adds Mneme's tasks to :preferred_cli_env
  • .formatter.exs - Adds :mneme to :import_deps
  • test/test_helper.exs - Adds Mneme.start() after ExUnit.start()

Example

Since your :mneme dependency is usually specified with only: :test, this task should be run with MIX_ENV=test.

$ MIX_ENV=test mix mneme.install

Igniter:
Update: .formatter.exs

1 1   |# Used by "mix format"
2 2   |[
3   - |  inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
  3 + |  inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"],
  4 + |  import_deps: [:mneme]
4 5   |]
5 6   |

Update: mix.exs

     ...|
 8  8   |      elixir: "~> 1.17",
 9  9   |      start_permanent: Mix.env() == :prod,
10    - |      deps: deps()
   10 + |      deps: deps(),
   11 + |      preferred_cli_env: ["mneme.test": :test, "mneme.watch": :test]
11 12   |    ]
12 13   |  end
     ...|

Update: test/test_helper.exs

1 1   |ExUnit.start()
  2 + |Mneme.start()

Proceed with changes? [y/n]