node-fetch-response-matchers:用于节点获取响应的Chai.js插件断言

时间:2021-05-18 17:24:29
【文件属性】:
文件名称:node-fetch-response-matchers:用于节点获取响应的Chai.js插件断言
文件大小:15KB
文件格式:ZIP
更新时间:2021-05-18 17:24:29
JavaScript 节点获取响应匹配器 带有匹配器的Chai插件,用于节点获取承诺响应。 它有助于使测试更具声明性。 TL; DR 这个库为您提供了声明性的方法来声明获取响应,还隐藏了promise及其回调的噪音: it ( 'some-test' , function ( ) { return expect ( fetch ( 'http://localhost/' ) ) . to . be . successful ( ) . and . to . haveBodyText ( 'foo' ) ; } ) ; 如果您不使用此库,它将变得非常冗长: it ( 'some-test' , function ( done ) { fetch ( 'http://localhost/' )
【文件预览】:
node-fetch-response-matchers-master
----.gitignore(108B)
----README.md(6KB)
----test()
--------header-tests-matchers.spec.js(2KB)
--------cookie-tests-matchers.spec.js(2KB)
--------body-tests-matchers.spec.js(3KB)
--------drivers()
--------.eslintrc(43B)
--------cache-control-tests-matchers.spec.js(3KB)
--------integration-test.spec.js(1KB)
--------status-tests-matchers.spec.js(2KB)
----package.json(856B)
----index.js(2KB)
----LICENSE.md(1KB)
----.npmignore(4B)
----.travis.yml(57B)
----lib()
--------cache-control-methods.js(2KB)
--------header-methods.js(1KB)
--------status-methods.js(972B)
--------cookie-methods.js(1KB)
--------body-methods.js(1KB)

网友评论