Skip to content

Commit 28093a0

Browse files
committed
build (test) : add jest and puppeteer
1 parent 907cbf6 commit 28093a0

File tree

4 files changed

+2111
-90
lines changed

4 files changed

+2111
-90
lines changed

.babelrc

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"presets": [
33
["@babel/preset-env", {
44
"targets": {
5+
"node": "current",
56
"browsers": ["last 2 versions", "IE 11", "> 0.25%"]
67
}
78
}]

config/setupTests.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import 'regenerator-runtime/runtime'

package.json

+12-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"private": false,
1010
"scripts": {
1111
"watch": "node_modules/.bin/webpack --mode=development --watch",
12-
"build": "node_modules/.bin/webpack --mode=production"
12+
"build": "node_modules/.bin/webpack --mode=production",
13+
"test": "jest --detectOpenHandles"
1314
},
1415
"dependencies": {
1516
"@babel/core": "^7.13.16",
@@ -24,17 +25,27 @@
2425
},
2526
"devDependencies": {
2627
"autoprefixer": "^10.3.3",
28+
"babel-jest": "^27.1.0",
2729
"css-loader": "^6.2.0",
2830
"eslint-config-prettier": "^8.3.0",
2931
"eslint-plugin-prettier": "^3.4.0",
32+
"jest": "^27.1.0",
33+
"jest-puppeteer": "^5.0.4",
3034
"postcss": "^8.3.6",
3135
"postcss-loader": "^6.1.1",
3236
"prettier": "^2.2.1",
37+
"puppeteer": "^10.2.0",
38+
"regenerator-runtime": "^0.13.9",
3339
"style-loader": "^3.2.1",
3440
"stylelint": "^13.13.1",
3541
"stylelint-config-recess-order": "^2.5.0",
3642
"stylelint-config-standard": "^22.0.0",
3743
"stylelint-webpack-plugin": "^3.0.1",
3844
"tailwindcss": "^2.2.9"
45+
},
46+
"jest": {
47+
"verbose": true,
48+
"preset": "jest-puppeteer",
49+
"setupFilesAfterEnv": ["./config/setupTests.js"]
3950
}
4051
}

0 commit comments

Comments
 (0)