Skip to content

Instantly share code, notes, and snippets.

@ianp
Created October 3, 2016 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ianp/0e44151b16718ebc83bb25efb68a9395 to your computer and use it in GitHub Desktop.
Save ianp/0e44151b16718ebc83bb25efb68a9395 to your computer and use it in GitHub Desktop.
The simplest Jest example.
{
"name": "foo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "jest"
},
"author": "",
"license": "ISC",
"devDependencies": {
"jest": "^16.0.0"
}
}
module.exports = (a, b) => a + b
const sum = require('./sum')
test('adds 1 + 2 to equal 3', () => {
expect(sum(1, 2)).toBe(3)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment