Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
RunKit + npm: jsdom
node v8.17.0
endpoint
share
tweet
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…
Clone and edit this document