test-utils: Bug: ReferenceError: XMLSerializer problems

Describe the bug Since release 2.0.0-rc.18 I sometimes encounter the following error when running my testsuite with JSDOM:

    TypeError: Failed to execute 'serializeToString' on 'XMLSerializer': parameter 1 is not of type 'Node'.

This does not happen with 2.0.0-rc.17. There are more issues with XMLSerializer, but this one is reproducable in a separate testcase. I can add more tests for the other issues when requested.

To Reproduce See the repo here: https://github.com/maerteijn/xmlserializer-problems-testcase See the CI result here: https://github.com/maerteijn/xmlserializer-problems-testcase/actions/runs/1720099564

Expected behavior That the test won’t fail due to the use of XMLSerializer. I have the feeling that it has a large impact on how vue-test-utils responds compared to previous versions.

Related information:

  • @vue/test-utils version: 2.0.0-rc.18
  • Vue version: 3.2.x
  • JSDOM version: 16.7 until v19.0
  • node version: v16.13.0
  • npm (or yarn) version: 8.1.0

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (6 by maintainers)

Most upvoted comments

A PR with a XMLSerializer global was merged, thank you all for helping out!

@cexbrayat Yes I think so. It’s not an issue with test-utils and your jest based test environment is working as it should.