From 535fff69b8e77b4010559df2af6164d05f6a251a Mon Sep 17 00:00:00 2001 From: Martijn Jacobs Date: Fri, 8 Apr 2022 15:06:09 +0200 Subject: [PATCH] fix: add XMLSerializer to the global scope In @vue/test-utils 2.0.0rc18, The usage of XMLSerializer was introduced: https://github.com/vuejs/test-utils/blob/d86cbc333de7b2ec1208f5d3c65e0879671dd01e/src/utils/stringifyNode.ts#L4 XMLSerializer needs to be available as a global so cli-plugin-unit-mocha will stay compatible with newer versions of @vue/test-utils. --- packages/@vue/cli-plugin-unit-mocha/setup.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/@vue/cli-plugin-unit-mocha/setup.js b/packages/@vue/cli-plugin-unit-mocha/setup.js index df81b0b514..accf1e4405 100644 --- a/packages/@vue/cli-plugin-unit-mocha/setup.js +++ b/packages/@vue/cli-plugin-unit-mocha/setup.js @@ -6,3 +6,6 @@ window.Date = Date global.ShadowRoot = window.ShadowRoot global.SVGElement = window.SVGElement + +// https://github.com/vuejs/test-utils/issues/1253 +global.XMLSerializer = window.XMLSerializer