Skip to content

Commit d9a3716

Browse files
committed
Fix global.navigator assignment issue with tests.
1 parent 2194a61 commit d9a3716

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

test/unit/helpers/init.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,16 @@ const { window } = jsdom;
4343
// set up test environment globals
4444
global.window = window;
4545
global.document = window.document;
46-
global.navigator = {
47-
platform: process.platform || '',
48-
userAgent: 'node.js',
49-
};
46+
47+
Object.defineProperty(global, 'navigator', {
48+
value: {
49+
platform: process.platform || '',
50+
userAgent: 'node.js',
51+
},
52+
configurable: true,
53+
writable: true,
54+
});
55+
5056
copyProps(window, global);
5157

5258
const config = {

0 commit comments

Comments
 (0)