Pure functions and basic tests in Jasmine
Published in
4 min readFeb 8, 2024
Pure functions are the perfect case for unit testing. For a given input, we always expect the same output-there is no internal state involved. Let’s take a look at a few examples and some simple tests that check if the methods work as expected.
Jasmine
Jasmine is a unit test framework for JavaScript. It can run tests in both Node.js or on the browser. It’s used…