From f562740a3addb327519e297bec5132d2295098e0 Mon Sep 17 00:00:00 2001 From: Kevin Schiffer Date: Thu, 29 Jun 2023 15:14:30 +0200 Subject: [PATCH] dev: Fix jest tests --- package.json | 13 ++++++------- sdk/js/package.json | 7 ++----- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 6eea71806c4..62a33606641 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@storybook/react": "^7.0.24", "@testing-library/cypress": "^9.0.0", "add-asset-html-webpack-plugin": "^6.0.0", - "babel-jest": "^29.3.1", + "babel-jest": "^29.5.0", "babel-loader": "^9.1.2", "babel-plugin-lodash": "^3.3.4", "babel-plugin-react-intl": "^3.0.1", @@ -53,6 +53,7 @@ "file-loader": "^6.2.0", "html-webpack-plugin": "^5.5.3", "jest": "^29.5.0", + "jest-environment-jsdom": "^29.5.0", "js-yaml": "^4.0.0", "json": "^11.0.0", "messageformat-parser": "^4.1.3", @@ -134,21 +135,18 @@ "url-template": "^3.1.0", "yup": "^1.2.0" }, - "resolutions": { - "cypress": "^7.7.0" - }, "babel": { "extends": "./config/babel.config.json" }, "jest": { - "setupFiles": [ + "setupFilesAfterEnv": [ "/config/jest/setup.js" ], "testMatch": [ "/pkg/**/*_test.js" ], "transform": { - "^.+\\.js$": "babel-jest", + "^.+\\.js$": ["babel-jest", { "configFile": "./config/babel.config.json" }], "\\.(css|styl|less|sass)$": "/config/jest/styles.transform.js", "\\.(jpg|jpeg|svg|png|woff|woff2|ttf|eot|gif|webp)$": "/config/jest/files.transform.js" }, @@ -158,7 +156,8 @@ "^\\@console(.*)": "/pkg/webui/console$1", "^\\@account(.*)": "/pkg/webui/account$1", "^\\@assets(.*)": "/pkg/webui/assets$1" - } + }, + "testEnvironment": "jest-environment-jsdom" }, "eslintConfig": { "extends": "./config/eslintrc.yaml" diff --git a/sdk/js/package.json b/sdk/js/package.json index cffcb3a1348..cd043e98fe0 100644 --- a/sdk/js/package.json +++ b/sdk/js/package.json @@ -54,11 +54,8 @@ "^.+\\.js$": "babel-jest" }, "transformIgnorePatterns": [ - "node_modules/(?!auto-bind)" - ], - "moduleNameMapper": { - "axios": "axios/dist/node/axios.cjs" - } + "node_modules/(?!(auto-bind|query-string|decode-uri-component))/" + ] }, "prettier": "../../config/.prettierrc.js", "dependencies": {