s3cur3 / credo_mox

Credo check for ensuring that Mox expect calls have been verified

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CredoMox

Credo Checks to ensure correct usage of the Mox library.

Provides a Credo check that ensures tests that have imported Mox and use the Mox.expect/4 function are verifying those expectations. See the CredoMox.Checks.UnverifiedMox module for more details.

Usage

To add the CredoMox.Checks.UnverifiedMox check to your Credo configuration, in your .credo.exs file add the UnverifiedMox module to your checks and configure it to only include test files:

# ... .credo.exs
  checks: [
    ## other Credo checks...
    {CredoMox.Checks.UnverifiedMox, files: %{included: ["**/*_test.exs"]}},
  ]

Installation

The package can be installed by adding credo_mox to your list of dependencies in mix.exs:

def deps do
  [
    {:credo_mox, "~> 0.1", only: [:dev, :test], runtime: false},
  ]
end

Docs can be found at https://hexdocs.pm/credo_mox.

About

Credo check for ensuring that Mox expect calls have been verified

License:Apache License 2.0


Languages

Language:Elixir 100.0%