Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3376002
D4709.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D4709.diff
View Options
diff --git a/web/.eslintrc.json b/web/.eslintrc.json
--- a/web/.eslintrc.json
+++ b/web/.eslintrc.json
@@ -1,6 +1,7 @@
{
"env": {
- "browser": true
+ "browser": true,
+ "jest": true
},
"globals": {
"process": true
diff --git a/web/babel.config.cjs b/web/babel.config.cjs
--- a/web/babel.config.cjs
+++ b/web/babel.config.cjs
@@ -7,4 +7,18 @@
'@babel/plugin-proposal-nullish-coalescing-operator',
['@babel/plugin-transform-runtime', { useESModules: true }],
],
+ env: {
+ test: {
+ presets: [
+ [
+ '@babel/preset-env',
+ {
+ targets: {
+ node: 'current',
+ },
+ },
+ ],
+ ],
+ },
+ },
};
diff --git a/web/package.json b/web/package.json
--- a/web/package.json
+++ b/web/package.json
@@ -7,7 +7,8 @@
"scripts": {
"clean": "rm -rf dist/ && rm -rf node_modules/",
"dev": "yarn concurrently --names=\"NODESSR,BROWSER\" -c \"bgBlue.bold,bgMagenta.bold\" \"yarn webpack --config webpack.config.cjs --config-name=server --watch\" \"yarn webpack-dev-server --hot --config webpack.config.cjs --config-name=browser\"",
- "prod": "yarn webpack --config webpack.config.cjs --env prod --progress"
+ "prod": "yarn webpack --config webpack.config.cjs --env prod --progress",
+ "test": "jest"
},
"devDependencies": {
"@babel/core": "^7.13.14",
@@ -22,6 +23,7 @@
"@babel/preset-react": "^7.13.13",
"@hot-loader/react-dom": "16.13.0",
"assets-webpack-plugin": "^3.9.7",
+ "babel-jest": "^26.6.3",
"babel-loader": "^8.1.0",
"babel-plugin-transform-remove-console": "^6.9.4",
"clean-webpack-plugin": "^3.0.0",
@@ -29,6 +31,7 @@
"css-loader": "^4.3.0",
"flow-bin": "^0.158.0",
"flow-typed": "^3.2.1",
+ "jest": "^26.6.3",
"mini-css-extract-plugin": "^0.11.2",
"optimize-css-assets-webpack-plugin": "^5.0.3",
"style-loader": "^1.2.1",
@@ -77,5 +80,16 @@
"simple-markdown": "^0.7.2",
"tinycolor2": "^1.4.1",
"visibilityjs": "^2.0.2"
+ },
+ "jest": {
+ "roots": [
+ "<rootDir>/utils"
+ ],
+ "transform": {
+ "\\.js$": "babel-jest"
+ },
+ "transformIgnorePatterns": [
+ "/node_modules/(?!@babel/runtime)"
+ ]
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 27, 9:47 PM (21 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2591778
Default Alt Text
D4709.diff (2 KB)
Attached To
Mode
D4709: [web] Add jest library to web
Attached
Detach File
Event Timeline
Log In to Comment