Skip to content

Mimic 1.10.0

Compare
Choose a tag to compare
@edgurgel edgurgel released this 02 Sep 09:38
· 6 commits to main since this release

What's Changed

  • Include .formatter.exs in published files by @bjyoungblood in #78
  • Experimental: Type checking for stubs and expectations by @edgurgel in #77

New Contributors

Full Changelog: v1.9.0...v1.10.0

Experimental type checking for copied modules

One can pass type_check: true when a module is copied to also get the function expected/stubbed to
validate the arguments and return value using Ham which is essentially
what Hammox improved on Mox.

Mimic.copy(:cowboy_req, type_check: true)

If there is any problem with the arguments or return values of the stubbed functions on your tests you might see
an error like this one:

     ** (Mimic.TypeCheckError) :cowboy_req.parse_qs/1: 1st argument value %{} does not match 1st parameter's type :cowboy_req.req().
       Could not find a map entry matching required(:method) => binary().

This feature is experimental at the moment which means that it might change a little bit how this
is configured and used. Feedback is welcome!