When testing in node (with jsdom), window is present, but not window.localStorage, so window.localStorage.DISABLE_NANOTIMING attempts to set DISABLE_NANOTIMING on undefined. This resolves that (though technically truly detecting localStorage can be more complicated).
When testing in node (with jsdom),
window
is present, but notwindow.localStorage
, sowindow.localStorage.DISABLE_NANOTIMING
attempts to setDISABLE_NANOTIMING
onundefined
. This resolves that (though technically truly detecting localStorage can be more complicated).