From 2f1ba4228a7a9a6f95a44258e615ba73461537bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9di-R=C3=A9mi=20Hashim?= <4295266+mediremi@users.noreply.github.com> Date: Mon, 30 Aug 2021 09:15:31 +0100 Subject: [PATCH] fix: set jsdom as default test environment (#624) * fix: set jsdom as default test environment * chore: bump jest-environment-jsdom --- cli/config/jest.config.js | 1 + cli/package.json | 2 +- yarn.lock | 98 +++++++++++++++++++-------------------- 3 files changed, 51 insertions(+), 50 deletions(-) diff --git a/cli/config/jest.config.js b/cli/config/jest.config.js index 8bf0550ab..a2a059a18 100644 --- a/cli/config/jest.config.js +++ b/cli/config/jest.config.js @@ -11,4 +11,5 @@ module.exports = { './jest.styled-jsx-css.mock.js' ), }, + testEnvironment: 'jsdom', } diff --git a/cli/package.json b/cli/package.json index 579cb1e3f..a4214ffb2 100644 --- a/cli/package.json +++ b/cli/package.json @@ -30,6 +30,7 @@ "@babel/preset-typescript": "^7.6.0", "@dhis2/app-shell": "8.0.0-beta.1", "@dhis2/cli-helpers-engine": "^3.0.0", + "@jest/core": "^27.0.6", "archiver": "^3.1.1", "axios": "^0.20.0", "babel-jest": "^27.0.6", @@ -45,7 +46,6 @@ "i18next-conv": "^9", "i18next-scanner": "^2.10.3", "inquirer": "^7.3.3", - "@jest/core": "^27.0.6", "lodash": "^4.17.11", "parse-author": "^2.0.0", "parse-gitignore": "^1.0.1", diff --git a/yarn.lock b/yarn.lock index be3ec8bed..0f41539ba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2254,15 +2254,15 @@ "@types/node" "*" jest-mock "^26.6.1" -"@jest/environment@^27.0.6": - version "27.0.6" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.0.6.tgz#ee293fe996db01d7d663b8108fa0e1ff436219d2" - integrity sha512-4XywtdhwZwCpPJ/qfAkqExRsERW+UaoSRStSHCCiQTUpoYdLukj+YJbQSFrZjhlUDRZeNiU9SFH0u7iNimdiIg== +"@jest/environment@^27.0.6", "@jest/environment@^27.1.0": + version "27.1.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-27.1.0.tgz#c7224a67004759ec203d8fa44e8bc0db93f66c44" + integrity sha512-wRp50aAMY2w1U2jP1G32d6FUVBNYqmk8WaGkiIEisU48qyDV0WPtw3IBLnl7orBeggveommAkuijY+RzVnNDOQ== dependencies: - "@jest/fake-timers" "^27.0.6" - "@jest/types" "^27.0.6" + "@jest/fake-timers" "^27.1.0" + "@jest/types" "^27.1.0" "@types/node" "*" - jest-mock "^27.0.6" + jest-mock "^27.1.0" "@jest/fake-timers@^26.6.1": version "26.6.1" @@ -2276,17 +2276,17 @@ jest-mock "^26.6.1" jest-util "^26.6.1" -"@jest/fake-timers@^27.0.6": - version "27.0.6" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.0.6.tgz#cbad52f3fe6abe30e7acb8cd5fa3466b9588e3df" - integrity sha512-sqd+xTWtZ94l3yWDKnRTdvTeZ+A/V7SSKrxsrOKSqdyddb9CeNRF8fbhAU0D7ZJBpTTW2nbp6MftmKJDZfW2LQ== +"@jest/fake-timers@^27.0.6", "@jest/fake-timers@^27.1.0": + version "27.1.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.1.0.tgz#c0b343d8a16af17eab2cb6862e319947c0ea2abe" + integrity sha512-22Zyn8il8DzpS+30jJNVbTlm7vAtnfy1aYvNeOEHloMlGy1PCYLHa4PWlSws0hvNsMM5bON6GISjkLoQUV3oMA== dependencies: - "@jest/types" "^27.0.6" + "@jest/types" "^27.1.0" "@sinonjs/fake-timers" "^7.0.2" "@types/node" "*" - jest-message-util "^27.0.6" - jest-mock "^27.0.6" - jest-util "^27.0.6" + jest-message-util "^27.1.0" + jest-mock "^27.1.0" + jest-util "^27.1.0" "@jest/globals@^26.6.1": version "26.6.1" @@ -2480,10 +2480,10 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" -"@jest/types@^27.0.6": - version "27.0.6" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.0.6.tgz#9a992bc517e0c49f035938b8549719c2de40706b" - integrity sha512-aSquT1qa9Pik26JK5/3rvnYb4bGtm1VFNesHKmNTwmPIgOrixvhL2ghIvFRNEpzy3gU+rUgjIF/KodbkFAl++g== +"@jest/types@^27.0.6", "@jest/types@^27.1.0": + version "27.1.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.1.0.tgz#674a40325eab23c857ebc0689e7e191a3c5b10cc" + integrity sha512-pRP5cLIzN7I7Vp6mHKRSaZD7YpBTK7hawx5si8trMKqk4+WOdK8NEKOTO2G8PKWD1HbKMVckVB6/XHh/olhf2g== dependencies: "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" @@ -8903,17 +8903,17 @@ jest-environment-jsdom@^26.6.1: jest-util "^26.6.1" jsdom "^16.4.0" -jest-environment-jsdom@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.0.6.tgz#f66426c4c9950807d0a9f209c590ce544f73291f" - integrity sha512-FvetXg7lnXL9+78H+xUAsra3IeZRTiegA3An01cWeXBspKXUhAwMM9ycIJ4yBaR0L7HkoMPaZsozCLHh4T8fuw== +jest-environment-jsdom@^27.0.6, jest-environment-jsdom@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-27.1.0.tgz#5fb3eb8a67e02e6cc623640388d5f90e33075f18" + integrity sha512-JbwOcOxh/HOtsj56ljeXQCUJr3ivnaIlM45F5NBezFLVYdT91N5UofB1ux2B1CATsQiudcHdgTaeuqGXJqjJYQ== dependencies: - "@jest/environment" "^27.0.6" - "@jest/fake-timers" "^27.0.6" - "@jest/types" "^27.0.6" + "@jest/environment" "^27.1.0" + "@jest/fake-timers" "^27.1.0" + "@jest/types" "^27.1.0" "@types/node" "*" - jest-mock "^27.0.6" - jest-util "^27.0.6" + jest-mock "^27.1.0" + jest-util "^27.1.0" jsdom "^16.6.0" jest-environment-node@^26.6.1: @@ -9089,18 +9089,18 @@ jest-message-util@^26.6.0, jest-message-util@^26.6.1: slash "^3.0.0" stack-utils "^2.0.2" -jest-message-util@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.0.6.tgz#158bcdf4785706492d164a39abca6a14da5ab8b5" - integrity sha512-rBxIs2XK7rGy+zGxgi+UJKP6WqQ+KrBbD1YMj517HYN3v2BG66t3Xan3FWqYHKZwjdB700KiAJ+iES9a0M+ixw== +jest-message-util@^27.0.6, jest-message-util@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.1.0.tgz#e77692c84945d1d10ef00afdfd3d2c20bd8fb468" + integrity sha512-Eck8NFnJ5Sg36R9XguD65cf2D5+McC+NF5GIdEninoabcuoOfWrID5qJhufq5FB0DRKoiyxB61hS7MKoMD0trQ== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^27.0.6" + "@jest/types" "^27.1.0" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.4" micromatch "^4.0.4" - pretty-format "^27.0.6" + pretty-format "^27.1.0" slash "^3.0.0" stack-utils "^2.0.3" @@ -9112,12 +9112,12 @@ jest-mock@^26.6.1: "@jest/types" "^26.6.1" "@types/node" "*" -jest-mock@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.0.6.tgz#0efdd40851398307ba16778728f6d34d583e3467" - integrity sha512-lzBETUoK8cSxts2NYXSBWT+EJNzmUVtVVwS1sU9GwE1DLCfGsngg+ZVSIe0yd0ZSm+y791esiuo+WSwpXJQ5Bw== +jest-mock@^27.0.6, jest-mock@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.1.0.tgz#7ca6e4d09375c071661642d1c14c4711f3ab4b4f" + integrity sha512-iT3/Yhu7DwAg/0HvvLCqLvrTKTRMyJlrrfJYWzuLSf9RCAxBoIXN3HoymZxMnYsC3eD8ewGbUa9jUknwBenx2w== dependencies: - "@jest/types" "^27.0.6" + "@jest/types" "^27.1.0" "@types/node" "*" jest-pnp-resolver@^1.2.2: @@ -9395,12 +9395,12 @@ jest-util@^26.6.0, jest-util@^26.6.1: is-ci "^2.0.0" micromatch "^4.0.2" -jest-util@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.0.6.tgz#e8e04eec159de2f4d5f57f795df9cdc091e50297" - integrity sha512-1JjlaIh+C65H/F7D11GNkGDDZtDfMEM8EBXsvd+l/cxtgQ6QhxuloOaiayt89DxUvDarbVhqI98HhgrM1yliFQ== +jest-util@^27.0.6, jest-util@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-27.1.0.tgz#06a53777a8cb7e4940ca8e20bf9c67dd65d9bd68" + integrity sha512-edSLD2OneYDKC6gZM1yc+wY/877s/fuJNoM1k3sOEpzFyeptSmke3SLnk1dDHk9CgTA+58mnfx3ew3J11Kes/w== dependencies: - "@jest/types" "^27.0.6" + "@jest/types" "^27.1.0" "@types/node" "*" chalk "^4.0.0" graceful-fs "^4.2.4" @@ -12186,12 +12186,12 @@ pretty-format@^26.6.0, pretty-format@^26.6.1: ansi-styles "^4.0.0" react-is "^17.0.1" -pretty-format@^27.0.6: - version "27.0.6" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.0.6.tgz#ab770c47b2c6f893a21aefc57b75da63ef49a11f" - integrity sha512-8tGD7gBIENgzqA+UBzObyWqQ5B778VIFZA/S66cclyd5YkFLYs2Js7gxDKf0MXtTc9zcS7t1xhdfcElJ3YIvkQ== +pretty-format@^27.0.6, pretty-format@^27.1.0: + version "27.1.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.1.0.tgz#022f3fdb19121e0a2612f3cff8d724431461b9ca" + integrity sha512-4aGaud3w3rxAO6OXmK3fwBFQ0bctIOG3/if+jYEFGNGIs0EvuidQm3bZ9mlP2/t9epLNC/12czabfy7TZNSwVA== dependencies: - "@jest/types" "^27.0.6" + "@jest/types" "^27.1.0" ansi-regex "^5.0.0" ansi-styles "^5.0.0" react-is "^17.0.1"