Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (17 sloc) 597 Bytes
import {JSDOM} from 'jsdom';
const {window} = new JSDOM('...');
// Extending global to recognize the new properties we're adding on.
declare global {
// Disabling this rule here, because this has to match exactly like in lib.dom.d.ts for merge declaration to happen.
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace NodeJS {
interface Global {
navigator: typeof window.navigator;
document: typeof window.document;
location: URL;
}
}
}
global.navigator = window.navigator;
global.document = window.document;
global.location = new URL('https://github.com');
You can’t perform that action at this time.
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.