From e685bf300dd6790f2edd9cc84d519fc74cdced04 Mon Sep 17 00:00:00 2001 From: Alan Alickovic Date: Sun, 28 Apr 2024 21:37:26 +0200 Subject: [PATCH] update --- package.json | 2 +- public/mockServiceWorker.js | 2 +- src/test/server/index.ts | 9 +++---- yarn.lock | 54 ++++++++++++++++++------------------- 4 files changed, 33 insertions(+), 34 deletions(-) diff --git a/package.json b/package.json index e6ed17ef..9b3197b2 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "jest-environment-jsdom": "^29.7.0", "jsdom": "^24.0.0", "lint-staged": "^11.0.0", - "msw": "^2.2.14", + "msw": "2.2.11", "plop": "^2.7.4", "postcss": "^8.4.38", "prettier": "^3.2.5", diff --git a/public/mockServiceWorker.js b/public/mockServiceWorker.js index e891a685..ded1c601 100644 --- a/public/mockServiceWorker.js +++ b/public/mockServiceWorker.js @@ -8,7 +8,7 @@ * - Please do NOT serve this file on production. */ -const PACKAGE_VERSION = '2.2.14' +const PACKAGE_VERSION = '2.2.11' const INTEGRITY_CHECKSUM = '26357c79639bfa20d64c0efca2a87423' const IS_MOCKED_RESPONSE = Symbol('isMockedResponse') const activeClientIds = new Set() diff --git a/src/test/server/index.ts b/src/test/server/index.ts index bf5549cd..7c3f3978 100644 --- a/src/test/server/index.ts +++ b/src/test/server/index.ts @@ -1,8 +1,7 @@ export const initMocks = async () => { - console.log('initMocks', import.meta.env.VITE_APP_API_MOCKING); - // if (import.meta.env.VITE_APP_API_MOCKING === 'true') { - const { worker } = await import('./browser'); + if (import.meta.env.VITE_APP_API_MOCKING === 'true') { + const { worker } = await import('./browser'); - return worker.start(); - // } + return worker.start(); + } }; diff --git a/yarn.lock b/yarn.lock index 0d41332e..30a7f1df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1467,10 +1467,10 @@ optionalDependencies: msw "^0.28.2" -"@mswjs/interceptors@^0.26.14": - version "0.26.15" - resolved "https://registry.yarnpkg.com/@mswjs/interceptors/-/interceptors-0.26.15.tgz#256ad5c89f325c87d972cc27fc7d0d6d382ce804" - integrity sha512-HM47Lu1YFmnYHKMBynFfjCp0U/yRskHj/8QEJW0CBEPOlw8Gkmjfll+S9b8M7V5CNDw2/ciRxjjnWeaCiblSIQ== +"@mswjs/interceptors@^0.25.16": + version "0.25.16" + resolved "https://registry.yarnpkg.com/@mswjs/interceptors/-/interceptors-0.25.16.tgz#7955fbb8da479bc691df117dd4c8d889e507ecc2" + integrity sha512-8QC8JyKztvoGAdPgyZy49c9vSHHAZjHagwl4RY9E8carULk8ym3iTaiawrT1YoLF/qb449h48f71XDPgkUSOUg== dependencies: "@open-draft/deferred-promise" "^2.2.0" "@open-draft/logger" "^0.3.0" @@ -7305,6 +7305,29 @@ ms@2.1.3, ms@^2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== +msw@2.2.11: + version "2.2.11" + resolved "https://registry.yarnpkg.com/msw/-/msw-2.2.11.tgz#7d580b859c9ede69768a95d905214999bc76bc0a" + integrity sha512-XtIoewF7XWLT0a39Ftkazt9PprBA1bxHZ4CSlomN74sCBJOJU2w5VwLmGlswwsOBhGoF7jovt6bxrSIESxA1KA== + dependencies: + "@bundled-es-modules/cookie" "^2.0.0" + "@bundled-es-modules/statuses" "^1.0.1" + "@inquirer/confirm" "^3.0.0" + "@mswjs/cookies" "^1.1.0" + "@mswjs/interceptors" "^0.25.16" + "@open-draft/until" "^2.1.0" + "@types/cookie" "^0.6.0" + "@types/statuses" "^2.0.4" + chalk "^4.1.2" + graphql "^16.8.1" + headers-polyfill "^4.0.2" + is-node-process "^1.2.0" + outvariant "^1.4.2" + path-to-regexp "^6.2.0" + strict-event-emitter "^0.5.1" + type-fest "^4.9.0" + yargs "^17.7.2" + msw@^0.28.2: version "0.28.2" resolved "https://registry.yarnpkg.com/msw/-/msw-0.28.2.tgz#5179df2c2f8c65e31b2043b8ec9cbe245ad0bd48" @@ -7329,29 +7352,6 @@ msw@^0.28.2: strict-event-emitter "^0.2.0" yargs "^16.2.0" -msw@^2.2.14: - version "2.2.14" - resolved "https://registry.yarnpkg.com/msw/-/msw-2.2.14.tgz#ed16b89f99ffc105a84b0295a6fcae2ee99f5c62" - integrity sha512-64i8rNCa1xzDK8ZYsTrVMli05D687jty8+Th+PU5VTbJ2/4P7fkQFVyDQ6ZFT5FrNR8z2BHhbY47fKNvfHrumA== - dependencies: - "@bundled-es-modules/cookie" "^2.0.0" - "@bundled-es-modules/statuses" "^1.0.1" - "@inquirer/confirm" "^3.0.0" - "@mswjs/cookies" "^1.1.0" - "@mswjs/interceptors" "^0.26.14" - "@open-draft/until" "^2.1.0" - "@types/cookie" "^0.6.0" - "@types/statuses" "^2.0.4" - chalk "^4.1.2" - graphql "^16.8.1" - headers-polyfill "^4.0.2" - is-node-process "^1.2.0" - outvariant "^1.4.2" - path-to-regexp "^6.2.0" - strict-event-emitter "^0.5.1" - type-fest "^4.9.0" - yargs "^17.7.2" - mute-stream@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d"