Browse Source

test(ui): Upgrade to jest 28 (#34761)

Scott Cooper 2 years ago
parent
commit
f259b49eba
3 changed files with 352 additions and 291 deletions
  1. 7 6
      package.json
  2. 3 1
      tests/js/jest-pegjs-transform.js
  3. 342 284
      yarn.lock

+ 7 - 6
package.json

@@ -37,7 +37,7 @@
     "@types/diff": "5.0.2",
     "@types/dompurify": "^2.3.3",
     "@types/enzyme": "^3.10.12",
-    "@types/jest": "^27.4.1",
+    "@types/jest": "^27.5.1",
     "@types/js-cookie": "^2.2.7",
     "@types/lodash": "^4.14.180",
     "@types/marked": "^0.7.2",
@@ -162,18 +162,19 @@
     "@storybook/router": "6.3.13",
     "@storybook/theming": "6.3.13",
     "@types/node": "^17.0.18",
-    "@visual-snapshot/jest": "5.0.0",
+    "@visual-snapshot/jest": "6.0.2",
     "babel-gettext-extractor": "^4.1.3",
-    "babel-jest": "27.5.1",
+    "babel-jest": "28.1.0",
     "babel-plugin-dynamic-import-node": "^2.2.0",
     "benchmark": "^2.1.4",
     "eslint": "8.12.0",
     "eslint-config-sentry-app": "^1.93.0",
     "html-webpack-plugin": "^5.5.0",
-    "jest": "27.5.1",
-    "jest-canvas-mock": "^2.3.1",
+    "jest": "28.1.0",
+    "jest-canvas-mock": "^2.4.0",
+    "jest-environment-jsdom": "^28.1.0",
     "jest-fetch-mock": "^3.0.3",
-    "jest-junit": "13.0.0",
+    "jest-junit": "13.2.0",
     "jest-sentry-environment": "1.7.1",
     "postcss-jsx": "0.36.4",
     "postcss-syntax": "0.36.2",

+ 3 - 1
tests/js/jest-pegjs-transform.js

@@ -13,7 +13,9 @@ function getCacheKey(fileData, _filePath, config, _options) {
 }
 
 function process(sourceText) {
-  return `module.exports = ${peg.generate(sourceText, {output: 'source'})}`;
+  return {
+    code: `module.exports = ${peg.generate(sourceText, {output: 'source'})}`,
+  };
 }
 
 module.exports = {getCacheKey, process};

File diff suppressed because it is too large
+ 342 - 284
yarn.lock


Some files were not shown because too many files changed in this diff