Here I show how to test your Javascript code. We will test pure functions (they are the easiest to test, because they don't have side effects). Then we test a function with side effects and we mock a global function using Jest. And finally we test an object method. We also talk about AAA (Arrange Act Assert) pattern here.