Cost
Speed
Testing pyramid
Unit testing tools
Jest
function sum(a, b) { return a + b; } module.exports = sum;
const sum = require('./sum'); test('adds 1 + 2 to equal 3', () => { expect(sum(1, 2)).toBe(3); });
How to add
yarn add --dev jest
{ "scripts": { "test": "jest" } }
yarn test