You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This module does not work with node.js because node doesn't have window or navigator objects.
I made a fork of the repo and modified the module so that it checks for the existence of those objects and, if they don't exist, attaches two objects under node.js global module.
Is there any interest in an PR?
The text was updated successfully, but these errors were encountered:
This is the code I used to get it working in node.js
// window and navigator globals need to be set for mock-geolocation
global.window = {};
global.navigator = {};
const geolocation = require('mock-geolocation');
geolocation.use();
// assign the mock geolocation to window
global.window.navigator = global.navigator;
window.navigator.geolocation = global.window.navigator.geolocation;
This module does not work with node.js because node doesn't have window or navigator objects.
I made a fork of the repo and modified the module so that it checks for the existence of those objects and, if they don't exist, attaches two objects under node.js global module.
Is there any interest in an PR?
The text was updated successfully, but these errors were encountered: