Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Cloud Contract support for Node JS?

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?

like image 280
nightfury Avatar asked Feb 12 '26 15:02

nightfury


1 Answers

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)

like image 127
Marcin Grzejszczak Avatar answered Feb 17 '26 01:02

Marcin Grzejszczak



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!