fetch-test-server:使用访存API测试node.js HTTP服务器

时间:2021-05-19 06:35:37
【文件属性】:
文件名称:fetch-test-server:使用访存API测试node.js HTTP服务器
文件大小:6KB
文件格式:ZIP
更新时间:2021-05-19 06:35:37
JavaScript Node.js获取测试服务器 该软件包使您可以轻松地运行Node.js服务器进行集成测试,并使用与之交互。 它与相似,但是使用Fetch API意味着您可以利用Promise和更新的ES2017功能(例如 。 安装 npm install --save-dev fetch-test-server 用法 创建一个新的TestServer实例,传入您的HTTP服务器。 然后,您可以调用fetch()对其发出请求。 本示例使用 (本机支持Promise),但是您可以使用任何喜欢的测试框架。 import { assert } from 'chai' ; import app from './myapp' ; const server = new TestServer ( app ) ; describe ( 'API Integration Test' , ( ) => { it (
【文件预览】:
fetch-test-server-master
----.travis.yml(51B)
----index.js(2KB)
----package.json(990B)
----.eslintrc.json(226B)
----LICENSE(1KB)
----index.test.js(3KB)
----.gitignore(34B)
----README.md(4KB)
----.editorconfig(99B)

网友评论