opaque: 不透明的
很多包底层都是依赖jsdom的。只需要在配置jsdom的属性上设置好url就能解决localstorage的问题。如:
jsdom-global
jsdomGlobal(htmlString, {
url: "http://localhost"
})
mocha-jsdom
jsdomMocha({
html: '',
src: '',
url: "http://localhost"
})
jsdom
jsdom(htmlString, {
url: "http://localhost"
})