TDD is very popular these two years, so we need to use unittest to protect our code being something wrong with refactor.
Yes, just using one library to write these code.
- Pure functional programming
Because we need to avoid side-effect in our function, so our tests will be useful.
- toEqual
expect(object).toEqual(value, [message])
- You need to test special scenario like js-undefined or empty object without property you need.