Spring Cloud Contract support for Node JS?

送分小仙女□ 提交于 2019-12-12 18:03:56

问题


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?


回答1:


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.

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)



来源:https://stackoverflow.com/questions/45828892/spring-cloud-contract-support-for-node-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!