A platform for community discussion. Free, open, simple.
DEV: Reduce console noise in qunit tests (#36044)
David Taylor9c36c7bf938a
diff --git a/frontend/discourse/app/app.js b/frontend/discourse/app/app.jsindex d4600a13052..88be3c78b9e 100644--- a/frontend/discourse/app/app.js+++ b/frontend/discourse/app/app.js@@ -277,7 +277,7 @@ function resolveDiscourseInitializer(moduleName, themeId) {let printedDebugInfo = false;function printDebugInfo() {- if (printedDebugInfo) {+ if (printedDebugInfo || isTesting()) {return;}diff --git a/frontend/discourse/tests/setup-tests.js b/frontend/discourse/tests/setup-tests.jsindex 8d209cf99f2..d2791cb2f4c 100644--- a/frontend/discourse/tests/setup-tests.js+++ b/frontend/discourse/tests/setup-tests.js@@ -53,6 +53,7 @@ import { loadSprites } from "../lib/svg-sprite-loader";import * as FakerModule from "@faker-js/faker";import { setLoadedFaker } from "discourse/lib/load-faker";+const REPORT_MEMORY = false;let cancelled = false;let started = false;@@ -186,6 +187,9 @@ function setupToolbar() {}function reportMemoryUsageAfterTests() {+ if (!REPORT_MEMORY) {+ return;+ }QUnit.done(() => {const usageBytes = performance.memory?.usedJSHeapSize;let result;diff --git a/package.json b/package.jsonindex 254d04681fe..b4fdb955d9f 100644--- a/package.json+++ b/package.json@@ -64,7 +64,8 @@"[email protected]": "patches/[email protected]","[email protected]": "patches/[email protected]","@ember-compat/[email protected]": "patches/@[email protected]",- "[email protected]": "patches/[email protected]"+ "[email protected]": "patches/[email protected]",+ "[email protected]": "patches/[email protected]"},"peerDependencyRules": {"allowedVersions": {diff --git a/patches/[email protected] b/patches/[email protected]new file mode 100644index 00000000000..027e9884ba8--- /dev/null+++ b/patches/[email protected]@@ -0,0 +1,23 @@+diff --git a/lib/http-proxy/common.js b/lib/http-proxy/common.js+index 6513e81d80d5250ea249ea833f819ece67897c7e..0555e80e25b8c4f4f21281e38c4c04069009dc0c 100644+--- a/lib/http-proxy/common.js++++ b/lib/http-proxy/common.js+@@ -1,6 +1,6 @@+ var common = exports,+ url = require('url'),+- extend = require('util')._extend,++ extend = Object.assign,+ required = require('requires-port');++ var upgradeHeader = /(^|,)\s*upgrade\s*($|,)/i,+diff --git a/lib/http-proxy/index.js b/lib/http-proxy/index.js+index 977a4b3622b9eaac27689f06347ea4c5173a96cd..739409c0dd0b93149fd174f4b085c3fbb522bf75 100644+--- a/lib/http-proxy/index.js++++ b/lib/http-proxy/index.js+@@ -1,5 +1,5 @@+ var httpProxy = module.exports,+- extend = require('util')._extend,++ extend = Object.assign,+ parse_url = require('url').parse,+ EE3 = require('eventemitter3'),+ http = require('http'),diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 75086e382e5..eefe6cd2708 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -20,6 +20,9 @@ patchedDependencies:hash: znalyv6akdxlqfpmxunrdi3osapath: patches/[email protected]+ hash: ymp5amxobtv5gnuhukua2wla6y+ path: patches/[email protected]hash: 55h346kvblvnigtrwrsh4hponapath: patches/[email protected]@@ -13814,7 +13817,7 @@ snapshots:heimdalljs-fs-monitor: 1.1.2heimdalljs-graph: 1.0.0heimdalljs-logger: 0.1.10- http-proxy: 1.18.1+ http-proxy: 1.18.1(patch_hash=ymp5amxobtv5gnuhukua2wla6y)inflection: 2.0.1inquirer: 9.3.8(@types/[email protected])is-git-url: 1.0.0@@ -15501,7 +15504,7 @@ snapshots:transitivePeerDependencies:- supports-color+ [email protected](patch_hash=ymp5amxobtv5gnuhukua2wla6y):dependencies:eventemitter3: 4.0.7follow-redirects: 1.15.11@@ -18609,7 +18612,7 @@ snapshots:express: 4.21.2fireworm: 0.7.2glob: 7.2.3- http-proxy: 1.18.1+ http-proxy: 1.18.1(patch_hash=ymp5amxobtv5gnuhukua2wla6y)js-yaml: 3.14.1lodash: 4.17.21mkdirp: 3.0.1