Skip to content

Commit 3047a80

Browse files
committed
Add testing via jest.
1 parent c214559 commit 3047a80

File tree

3 files changed

+1955
-21
lines changed

3 files changed

+1955
-21
lines changed

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
"main": "dist/index.js",
66
"scripts": {
77
"build": "babel src -o dist/index.js",
8-
"dev": "watch 'yarn run build' src"
8+
"dev": "watch 'yarn run build' src",
9+
"test": "jest",
10+
"test:watch": "yarn run test -- --watch"
911
},
1012
"babel": {
1113
"presets": [
@@ -20,6 +22,7 @@
2022
"@babel/cli": "^7.17.6",
2123
"@babel/core": "^7.17.9",
2224
"@babel/preset-env": "^7.16.11",
25+
"jest": "^27.5.1",
2326
"watch": "^1.0.2"
2427
}
2528
}

src/index.test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { helloWord } from ".";
2+
3+
describe("helloWord", () => {
4+
test("is hello world", () => {
5+
expect(helloWord()).toBe("Hello, World!");
6+
});
7+
});

0 commit comments

Comments
 (0)