axios-test-instance:使用Axios测试NodeJS后端

时间:2021-02-03 17:37:14
【文件属性】:
文件名称:axios-test-instance:使用Axios测试NodeJS后端
文件大小:110KB
文件格式:ZIP
更新时间:2021-02-03 17:37:14
nodejs testing http koa express Axios测试实例 使用Axios测试NodeJS后端 安装 npm install axios-test-instance 用法 通过将您的应用程序(可能是Koa应用程序,Express应用程序或HTTP请求处理程序) setTestApp给beforeAll或beforeEach块中的beforeAll来创建Axios测试实例。 导入request并在测试中使用它。 import { request , setTestApp } from 'axios-test-instance' ; import app from './app' ; beforeAll ( async ( ) =>
【文件预览】:
axios-test-instance-master
----package.json(2KB)
----__tests__()
--------callback.ts(611B)
--------fastify.ts(535B)
--------express.ts(521B)
--------form-data.ts(1KB)
--------koa.ts(499B)
--------tests.ts(3KB)
--------e2e.ts(2KB)
----.github()
--------workflows()
----.prettierrc.yaml(55B)
----.prettierignore(47B)
----jest.config.js(141B)
----.eslintrc.yaml(175B)
----tsconfig.json(254B)
----tsconfig-build.json(136B)
----LICENSE.md(1KB)
----.gitignore(53B)
----README.md(2KB)
----yarn.lock(243KB)
----.editorconfig(208B)
----index.ts(6KB)

网友评论