June 2025
Intermediate to advanced
837 pages
24h 50m
English
Unit tests are created at the function level, so you use them to secure the building blocks of your application. In practice, this means that you call a function with certain parameters and then compare the return value of that function with the value you expect to be returned. For the development of the function, this means it should have as few external dependencies as possible. If dependencies are required, they should be passed to the function via the input values.
When implementing your source code, you should make sure that the code is testable. This means inputs should be made as little as possible via global variables or object properties, but they should be passed explicitly to the function ...
Read now
Unlock full access