Skip to content

Commit

Permalink
feat: jest get-started
Browse files Browse the repository at this point in the history
  • Loading branch information
afeiship committed Nov 26, 2021
1 parent baee772 commit e3450bb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/2021-11/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "2021-11",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "jest"
},
"keywords": [],
"author": "afeiship",
"license": "ISC",
"devDependencies": {
"jest": "^27.3.1"
}
}
5 changes: 5 additions & 0 deletions src/2021-11/sum.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function sum(a, b) {
return a + b;
}

module.exports = sum;
5 changes: 5 additions & 0 deletions src/2021-11/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);
});

0 comments on commit e3450bb

Please sign in to comment.