Making HTTP requests in tests isn't a great idea in most situations... it can slow your tests down, is unreliable, and the API you are making requests to may not appreciate it either. So how do you avoid making HTTP requests in your tests? If you are…| Leigh Halliday's RSS Feed
In our tests we don't want to perform an actual HTTP request. To start with it is slow, but there are certain calls you really can't make with every test run, for example charging someone's credit card. In this article we'll look at a function that…| Leigh Halliday's RSS Feed
In this article below we will test a component which runs asynchronous code inside of its componentDidMount lifecycle event. We'll look at how to avoid making real AJAX requests through the mocking functionality provided by Jest, as well as learn a…| Leigh Halliday's RSS Feed
The José Valim approved (tm) way of introducing mocks1 into Elixir is through injecting implementations of explicit contracts defined by behaviours. José and pals crystallised this approach with the popular Mox hexicle. There’s some awkward terminology around all this which is probably not important. I should really say test double but I’ve always found that an awkward phrase. See XUnit patters for definitions. It is common in Elixir Land (as other places) to use Mock for Test Doubles s...| The log of Paul Wilson