From efb2d517d609dcf20c5db932f6eb485e141c3d97 Mon Sep 17 00:00:00 2001 From: Joshua Carter Date: Thu, 25 Apr 2024 12:17:02 -0700 Subject: [PATCH] Completly disable console logging in jquery-migrate --- packages/flow-client/src/app/red/mock-red.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/flow-client/src/app/red/mock-red.ts b/packages/flow-client/src/app/red/mock-red.ts index 29921fe..03df1d4 100644 --- a/packages/flow-client/src/app/red/mock-red.ts +++ b/packages/flow-client/src/app/red/mock-red.ts @@ -164,8 +164,20 @@ export const createMockRed = ( jQuery(selector, context)) as typeof jQuery; Object.assign(RED.$, jQuery); // jQuery plugins - (RED.$ as typeof RED.$ & { migrateMute: boolean }).migrateMute = true; - applyJqueryMigrate(RED.$, window); + applyJqueryMigrate( + RED.$, + // migrateMute doesn't mute enough + Object.assign({}, window, { + console: { + warn: () => undefined, + error: () => undefined, + log: () => undefined, + info: () => undefined, + debug: () => undefined, + trace: () => undefined, + }, + }) + ); applyJqueryUi(RED.$); const jQueryUi = RED.$ as typeof jQuery & { widget: (name: string, widget: Record) => void;