Popularity
6.7
Stable
Activity
0.0
Stable
101
4
2

Description

In functional languages you should write pure functions. However, sometimes we need functions to call external API’s that affect the state of the system. So these functions are impure. In non-functional languages you create mocks to test expectations. For example, you might create a mock of a repository and the test checks it calls the save function. You are testing a side effect. This is something you should avoid in functional languages.

Instead of mocks we should use stubs. Mocking frameworks tend to treat them as interchangeable and this makes it hard to tell them apart. So it is good to have a simple definition. Quoting Martin Fowler:

Monthly Downloads: 2,668
Programming language: Elixir
License: MIT License
Tags: Testing     Stubbing Framework     Stubbing     API    

Stubr alternatives and similar packages

Based on the "Testing" category

Do you think we are missing an alternative of Stubr or a related project?

Add another 'Testing' Package