mock icon indicating copy to clipboard operation
mock copied to clipboard

Feature Request: Support per-process mocking

Open jtrees opened this issue 3 years ago • 3 comments

It would be cool if it was possible to use mock with async: true in tests. Mox supports this.

jtrees avatar Jul 23 '21 10:07 jtrees

Interesting... I'm curious what feature(s) this library has that Mox doesn't that is still keeping you with library?

Olshansk avatar Jul 23 '21 11:07 Olshansk

I don't want to be forced to add behaviours just to mock something.

jtrees avatar Jul 25 '21 20:07 jtrees

+1

Mox requires you to add behaviors and substitute modules globally in the test scope. While it can be true from an idealistic perspective, on the practice:

  • it leads to dynamic resolution of modules. This is bad for dialyzer and autocompletion.
  • it makes code more complex, especially for simple services that are dealing with multiple remote resources.
  • I may want to have tests that are calling to real external API, just exclude them from CI

ffloyd avatar Jan 28 '22 18:01 ffloyd