Getting Started (ok)
https://jestjs.io/docs/getting-started
yarn add --dev jestfunction 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);
});{
"scripts": {
"test": "jest"
}
}Running from command line
Generate a basic configuration file
Using Babel
Last updated