Uploaded image for project: 'OpenShift Dev Console'
  1. OpenShift Dev Console
  2. ODC-6194

Test Failure: Node v15 issue with Async tests + jest.spyOn

    XMLWordPrintable

Details

    • ODC Sprint 211
    • Low

    Description

      Description of problem:

      Per the discussion thread of when I ran into this for the Pipeline package, the issue appears to only show itself up on v15 of node.

      Prerequisites (if any, like setup, operators/versions):

      None, test issue

      Steps to Reproduce

      1. Run `frontend/packages/knative-plugin/src/components/overview/_tests_/RevisionsOverviewList.spec.tsx` tests

      Actual results:

       RUNS  packages/knative-plugin/src/components/overview/__tests__/RevisionsOverviewList.spec.tsx
      node:internal/process/promises:245
                triggerUncaughtException(err, true /* fromPromise */);
                ^
      [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "Error: Target container is not a DOM element.".] {
        code: 'ERR_UNHANDLED_REJECTION'
      }
      

      Expected results:

      Tests to pass on v15 of node.

      Reproducibility (Always/Intermittent/Only Once):

      Always on v15, NOT on v14.

      Build Details:

      71167b267da5907553a88f588b8f16b38cda5585 of master (4.9)

      Additional info:

      ODC-5824 was the Pipeline issue, fixed in https://github.com/openshift/console/pull/8892

      My thoughts at the time:

      Fixes up a couple tests so they can work with node-v15 – jest.spyOn invokes the method with no arguments and one of our methods was incorrectly trying to test that a try/catch caught errors and mocked a situation where an undefined Pipeline object was being invoked for .metadata.name

      Attachments

        Activity

          People

            cjerolim Christoph Jerolimov
            aballantyne Andrew Ballantyne
            Sanket Pathak Sanket Pathak
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: