diff --git a/UI/package.json b/UI/package.json index 54c0442701..ba72f51765 100644 --- a/UI/package.json +++ b/UI/package.json @@ -124,7 +124,7 @@ "stylelint-webpack-plugin": "5.0.1", "tmp": "0.2.3", "typescript": "5.7.2", - "undici": "6.21.0", + "undici": "7.2.0", "unix-timestamp": "1.1.0", "unused-webpack-plugin": "2.4.0", "vue-i18n-extract-translations": "0.1.3", diff --git a/UI/tests/common/jest-setup.js b/UI/tests/common/jest-setup.js index e9abf7514e..3304da72e0 100644 --- a/UI/tests/common/jest-setup.js +++ b/UI/tests/common/jest-setup.js @@ -8,10 +8,10 @@ import { afterEach } from "@jest/globals"; import "core-js"; +import { server } from "./mocks/server.js"; import { setGlobalOrigin } from "undici"; import "./mocks/lsmb_elements"; -import { server } from "./mocks/server.js"; Object.defineProperty(window, "lsmbConfig", { writable: true, diff --git a/UI/tests/common/mocks/server.js b/UI/tests/common/mocks/server.js index 428359a091..774bcdd56f 100644 --- a/UI/tests/common/mocks/server.js +++ b/UI/tests/common/mocks/server.js @@ -1,7 +1,14 @@ /** @format */ +/* global globalThis */ import { setupServer } from "msw/node"; import { handlers } from "./handlers"; +const { MessageChannel, MessagePort } = require("node:worker_threads"); // This configures a Service Server with the given request handlers. export const server = setupServer(...handlers); + +Object.defineProperties(globalThis, { + MessageChannel: { value: MessageChannel }, + MessagePort: { value: MessagePort } +}); diff --git a/UI/yarn.lock b/UI/yarn.lock index 0048200329..2485dcca87 100644 --- a/UI/yarn.lock +++ b/UI/yarn.lock @@ -10266,10 +10266,10 @@ undici-types@~6.19.8: resolved "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz" integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== -undici@6.21.0: - version "6.21.0" - resolved "https://registry.yarnpkg.com/undici/-/undici-6.21.0.tgz#4b3d3afaef984e07b48e7620c34ed8a285ed4cd4" - integrity sha512-BUgJXc752Kou3oOIuU1i+yZZypyZRqNPW0vqoMPl8VaoalSfeR0D8/t4iAS3yirs79SSMTxTag+ZC86uswv+Cw== +undici@7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/undici/-/undici-7.2.0.tgz#446219e2a57cfcbdc2f135fcfa6dc662b3cae169" + integrity sha512-klt+0S55GBViA9nsq48/NSCo4YX5mjydjypxD7UmHh/brMu8h/Mhd/F7qAeoH2NOO8SDTk6kjnTFc4WpzmfYpQ== unicode-canonical-property-names-ecmascript@^2.0.0: version "2.0.1"