Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
Add simple jest example 👍
Browse files Browse the repository at this point in the history
  • Loading branch information
sicktastic committed Nov 23, 2017
1 parent 94a784c commit 679dec1
Show file tree
Hide file tree
Showing 5 changed files with 5,097 additions and 0 deletions.
8 changes: 8 additions & 0 deletions testing_frameworks/jest/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"devDependencies": {
"jest": "^21.2.1"
},
"scripts": {
"test": "jest"
}
}
4 changes: 4 additions & 0 deletions testing_frameworks/jest/sum.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
function sum(a, b) {
return a + b;
}
module.exports = sum;
5 changes: 5 additions & 0 deletions testing_frameworks/jest/sum.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const sum = require('./sum');

test('adds 1 + 2 to equal 3', () => {
expect(sum(1, 2)).toBe(3);
});
Loading

0 comments on commit 679dec1

Please sign in to comment.