We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c612c0b commit 2169818Copy full SHA for 2169818
packages/router/__tests__/utils.ts
@@ -108,11 +108,15 @@ export function createDom(options?: ConstructorOptions) {
108
}
109
)
110
111
- // @ts-expect-error: needed for jsdom
112
- global.window = dom.window
113
- global.location = dom.window.location
114
- global.history = dom.window.history
115
- 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
116
+ global.document = dom.window.document
117
+ } catch (erro) {
118
+ // it's okay, some are readonly
119
+ }
120
121
return dom
122
0 commit comments