Skip to content

Commit cbad889

Browse files
committed
Modified package.json and add .babelrc to support unit test
1 parent 6bca322 commit cbad889

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets":["@babel/env", "@babel/typescript"]
3+
}

package.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"scripts": {
4141
"start": "react-scripts start",
4242
"build": "react-scripts build",
43-
"test": "react-scripts test",
43+
"test": "jest",
4444
"eject": "react-scripts eject"
4545
},
4646
"eslintConfig": {
@@ -61,5 +61,20 @@
6161
"keymirror": "^0.1.1",
6262
"redux-logger": "^3.0.6",
6363
"tslint": "^5.13.1"
64+
},
65+
"jest": {
66+
"moduleFileExtensions": [
67+
"js",
68+
"jsx",
69+
"json",
70+
"ts"
71+
],
72+
"testMatch": [
73+
"**/__tests__/**/*.(js|ts)?(x)",
74+
"**/?(*.)(spec|test).(js|ts)?(x)"
75+
],
76+
"transform": {
77+
"^.+\\.tsx?$": "babel-jest"
78+
}
6479
}
6580
}

0 commit comments

Comments
 (0)