Skip to content

Intermittent error in @sheerun/mutationobserver-shim #348

Closed
@pelotom

Description

@pelotom
  • DOM Testing Library version: 6.1.0
  • node version: 11.15.0
  • npm (or yarn) version: 1.17.3

Problem description:

I'm seeing this intermittent error in my tests:

TypeError: Cannot read property 'nodeType' of null

      at copy (node_modules/@sheerun/mutationobserver-shim/MutationObserver.js:504:45)
      at clone (node_modules/@sheerun/mutationobserver-shim/MutationObserver.js:533:11)
      at createMutationSearcher (node_modules/@sheerun/mutationobserver-shim/MutationObserver.js:178:25)
      at MutationObserver.observe (node_modules/@sheerun/mutationobserver-shim/MutationObserver.js:110:21)
      at Promise (node_modules/@testing-library/dom/dist/wait-for-element.js:31:14)
      at waitForElement (node_modules/@testing-library/dom/dist/wait-for-element.js:22:10)
      at asyncWrapper (node_modules/@testing-library/dom/dist/wait-for-element.js:67:54)
      at node_modules/@testing-library/react/dist/pure.js:51:22
      at batchedUpdates$1 (node_modules/react-dom/cjs/react-dom.development.js:21643:12)
      at act (node_modules/react-dom/cjs/react-dom-test-utils.development.js:1002:14)
      at act (node_modules/react-dom/cjs/react-dom-test-utils.development.js:1418:12)
      at asyncAct (node_modules/@testing-library/react/dist/act-compat.js:118:12)

Unfortunately it's a heisenbug which only seems to reproduce (sometimes) when running the full suite of tests in our proprietary codebase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions