]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
ci: fix maybe
authorEduardo San Martin Morote <posva13@gmail.com>
Thu, 18 May 2023 16:39:35 +0000 (18:39 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Thu, 18 May 2023 16:39:35 +0000 (18:39 +0200)
packages/router/__tests__/utils.ts

index 2922ea5f557e0993f1f56690382da712e581e609..620757ce7fd800b5b02770982932d7932c58c61b 100644 (file)
@@ -108,11 +108,15 @@ export function createDom(options?: ConstructorOptions) {
     }
   )
 
-  // @ts-expect-error: needed for jsdom
-  global.window = dom.window
-  global.location = dom.window.location
-  global.history = dom.window.history
-  global.document = dom.window.document
+  try {
+    // @ts-expect-error: not the same window
+    global.window = dom.window
+    global.location = dom.window.location
+    global.history = dom.window.history
+    global.document = dom.window.document
+  } catch (erro) {
+    // it's okay, some are readonly
+  }
 
   return dom
 }