Spring Cloud Contract是否支持Node JS? [英] Spring Cloud Contract support for Node JS?

查看:128
本文介绍了Spring Cloud Contract是否支持Node JS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

JS节点侧是否有等效的Verifier?是否可以在可以访问存根的JS Node中编写Rest API测试?

Is there a Verifier equivalent on the JS Node side? Is it possible to write Rest API test in JS Node that can access the stubs?

推荐答案

当前,我们不支持即兴生成测试.但是,由于sc合同是可插入的( https://cloud .spring.io/spring-cloud-contract/spring-cloud-contract.html#_pluggable_architecture ),编写一个生成节点js测试的测试生成器没有问题.如果您不接受该协议,则可以签出Pact并使用其api. SC合同还将Pact文件理解为合同定义.

Currently we don't support the tests generation out of the box. However since sc contract is pluggable (https://cloud.spring.io/spring-cloud-contract/spring-cloud-contract.html#_pluggable_architecture) there's no problem to write a test generator that will generate a node js test. If that's not acceptable for you you can check out Pact and use their api. SC contract also understands Pact files as contract definition.

关于使用存根,您可以使用Stun Runner Boot应用程序下载并启动节点js应用程序可以使用的存根(示例

As for using stubs you can use the Stun Runner Boot application to download and start stubs that your node js application can use (example https://github.com/marcingrzejszczak/sc-contract-car-rental/blob/master/README.adoc#stub-runner-boot-with-a-nodejs-ap)

这篇关于Spring Cloud Contract是否支持Node JS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆