Pure functions and basic tests in Jasmine

Marcin
How to dev
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…

--

--

Marcin
How to dev

I program in JavaScript, write about IT & draw illustrations.