文件名称:browser-env:使用jsdom模拟全局浏览器环境
文件大小:11KB
文件格式:ZIP
更新时间:2024-02-27 05:18:05
testing jsdom window-namespace TestingJavaScript
浏览器环境 使用模拟全局浏览器环境。 这使您可以轻松或不费劲地在Node.js 6或更高版本中运行浏览器模块。 也可以用于通过任何Node.js测试框架测试浏览器模块。 请注意,只有DOM是模拟的,如果您要运行需要更多高级浏览器功能的模块(例如localStorage ),则需要分别进行polyfill。 使用browser-env@2支持较旧的Node.js版本。 :exclamation_mark: 重要的提示 此模块将属性从jsdom窗口命名空间添加到Node.js全局命名空间。 jsdom明确jsdom 。 在某些情况下,这可能适合您的用例,但请仔细阅读链接的Wiki页面,并确保您了解警告。 如果您不需要全局启
【文件预览】:
browser-env-master
----src()
--------index.js(2KB)
----register.js(62B)
----.npmignore(5B)
----.travis.yml(141B)
----LICENSE(1KB)
----test()
--------properties-arg-should-set-globals.js(586B)
--------existing-node-globals-shouldnt-get-overwritten.js(148B)
--------fixtures()
--------function-should-return-window-instance.js(137B)
--------function-should-overwrite-dom-globals-on-each-call.js(276B)
--------register-entry-must-preload-env.js(234B)
--------function-should-setup-browser-environment.js(393B)
--------window-properties-should-be-as-expected.js(269B)
--------arguments-should-be-able-to-be-passed-in-in-either-order.js(292B)
--------jsdom-arg-should-set-jsdom-config.js(234B)
--------function-shouldnt-return-the-same-instance.js(110B)
--------existing-falsey-node-globals-dont-get-overwritten.js(207B)
----README.md(3KB)
----.gitignore(39B)
----package.json(1KB)