Skip to content

Commit 1418b71

Browse files
committed
Add Jest Testing Framework to Project.
1 parent 2ec3151 commit 1418b71

File tree

3 files changed

+1223
-36
lines changed

3 files changed

+1223
-36
lines changed

jest.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
roots: ['<rootDir>/src'],
3+
transform: {
4+
'^.+\\.tsx?$': 'ts-jest',
5+
},
6+
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$',
7+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
8+
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"static": "cross-env NODE_ENV=production ts-node index.ts",
1616
"start": "cross-env ts-node index.ts",
1717
"stylelint": "stylelint src",
18-
"test": "echo \"Error: no test specified\" && exit 1"
18+
"test": "jest"
1919
},
2020
"author": "James A. Black Jr. <[email protected]>",
2121
"license": "MIT",
@@ -70,6 +70,7 @@
7070
"@types/compression-webpack-plugin": "^2.0.0",
7171
"@types/history": "^4.7.2",
7272
"@types/html-webpack-plugin": "^3.2.0",
73+
"@types/jest": "^24.0.6",
7374
"@types/kcors": "^2.2.3",
7475
"@types/koa": "^2.0.48",
7576
"@types/koa-router": "^7.0.38",
@@ -114,6 +115,7 @@
114115
"html-webpack-plugin": "^3.2.0",
115116
"htmllint": "^0.7.3",
116117
"husky": "^1.3.1",
118+
"jest": "^24.1.0",
117119
"koa-webpack": "^5.2.1",
118120
"less": "^3.9.0",
119121
"less-loader": "^4.1.0",
@@ -132,6 +134,7 @@
132134
"stylelint": "^9.10.1",
133135
"stylelint-config-recommended-scss": "^3.2.0",
134136
"stylelint-scss": "^3.5.3",
137+
"ts-jest": "^24.0.0",
135138
"ts-loader": "^5.3.3",
136139
"tslint": "^5.12.1",
137140
"tslint-config-prettier": "^1.18.0",

0 commit comments

Comments
 (0)