From ae07b4636f9ac13569611bf451d65e0165f20ace Mon Sep 17 00:00:00 2001 From: Muhammad Afaq Shuaib Date: Mon, 19 Aug 2024 18:44:40 +0500 Subject: [PATCH] chore: remove unhandledPromiseRejection Error in Frontend-app-publisher (#976) * chore: remove unhandled exception warning * chore: update snapshots --- .../CollapsibleCourseRun.test.jsx.snap | 260 +----------------- src/setupTest.js | 5 - 2 files changed, 10 insertions(+), 255 deletions(-) diff --git a/src/components/EditCoursePage/__snapshots__/CollapsibleCourseRun.test.jsx.snap b/src/components/EditCoursePage/__snapshots__/CollapsibleCourseRun.test.jsx.snap index 5dff91f98..88e1a775b 100644 --- a/src/components/EditCoursePage/__snapshots__/CollapsibleCourseRun.test.jsx.snap +++ b/src/components/EditCoursePage/__snapshots__/CollapsibleCourseRun.test.jsx.snap @@ -60,14 +60,7 @@ exports[`Collapsible Course Run renders correctly restriction type field for ext text="edX101+DemoX" > @@ -752,14 +728,7 @@ exports[`Collapsible Course Run renders correctly restriction type field for ext text="edX101+DemoX" > @@ -1444,14 +1396,7 @@ exports[`Collapsible Course Run renders correctly variant_id field for external text="edX101+DemoX" > @@ -2136,14 +2064,7 @@ exports[`Collapsible Course Run renders correctly when given a published course text="edX101+DemoX" > @@ -2752,14 +2656,7 @@ exports[`Collapsible Course Run renders correctly when given an unpublished cour text="edX101+DemoX" > @@ -3368,14 +3248,7 @@ exports[`Collapsible Course Run renders correctly when submitting for review 1`] text="edX101+DemoX" > @@ -3984,14 +3840,7 @@ exports[`Collapsible Course Run renders correctly when submitting for review and text="edX101+DemoX" > @@ -4600,14 +4432,7 @@ exports[`Collapsible Course Run renders correctly with a course run type 1`] = ` text="edX101+DemoX" > @@ -5228,14 +5036,7 @@ exports[`Collapsible Course Run renders correctly with external key field enable text="edX101+DemoX" > @@ -5880,14 +5664,7 @@ exports[`Collapsible Course Run renders correctly with no fields 1`] = ` onCopy={[Function]} > diff --git a/src/setupTest.js b/src/setupTest.js index 16ef17044..700cf3398 100644 --- a/src/setupTest.js +++ b/src/setupTest.js @@ -60,8 +60,3 @@ Object.defineProperty(window, 'matchMedia', { // Disable all react-beautiful-dnd development warnings. // See https://github.com/atlassian/react-beautiful-dnd/issues/1593 window['__react-beautiful-dnd-disable-dev-warnings'] = true; - -// Upgrading to Node16 shows unhandledPromiseRejection warnings as errors so adding a handler -process.on('unhandledRejection', (reason, p) => { - console.log('Unhandled Rejection at: Promise', p, 'reason:', reason.stack); // eslint-disable-line no-console -});