RunKit + npm: jsdom

node v8.16.0
endpointsharetweet
const { JSDOM } = require("jsdom") const { window } = new JSDOM(``, { url: "https://example.com/" }); console.log("before", window.localStorage.setItem); Object.defineProperty(window, 'localStorage', {value: {}}) console.log("after", window.localStorage.setItem);
Created from: https://npm.runkit.com/jsdom
Loading…