expect.equal
If the only available assertion in every test suite was equal(), almost every test suite in the world would be better for it. Because equal() by nature answers the two most important questions every unit test must answer: 1) What is the actual output?, 2) What is expected output? ~ Eric Elliot
Motivation
If you are writing in a pure functional style, which means a) no side-effect, b) no shared/global state. You only need to test the input to the output. There is nothing else to test. Since pure functions transform data (from A -> B, from raw to HTML etc.). If you need to test side-effects such as a database connection, HTTP calls, reading/writing to disk, you need to use integrational tests. Mocking is a code smell.
API
moduleexports = expect
Examples
const compose = fns const id = xconst double = x * xconst triple = x * x * x const multiply = const test = 1'id() should return 1' 4'double() should return 4' 8'triple() should return 8' // multiply() doesn't need to be tested, since it's a composition// of 3 functions that have already been tested.