Skip to content

Commit 117bd6c

Browse files
committed
imp(tests): add sample test
1 parent 1bd06a7 commit 117bd6c

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "Simplify Front-End development",
55
"main": "gulpfile.js",
66
"dependencies": {
7+
"@types/jest": "^26.0.14",
78
"@types/react": "^16.9.23",
89
"@types/react-dom": "^16.9.5",
910
"lodash": "^4.17.15",
@@ -31,6 +32,7 @@
3132
"webpack-stream": "^5.2.1",
3233
"ts-loader": "^6.2.1",
3334
"typescript": "^3.8.2",
35+
"jest": "^26.4.2",
3436
"node-sass": "^4.13.0"
3537
},
3638
"scripts": {

src/javascript/sum.test.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const sum = require('./sum');
2+
3+
test('adds 1 + 2 to equal 3', () => {
4+
expect(sum(1, 2)).toBe(3);
5+
});

src/javascript/sum.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
function sum(a, b) {
2+
return a + b;
3+
}
4+
5+
module.exports = sum;

0 commit comments

Comments
 (0)