Miss WireMock in Java? This is the Nodejs sibling to WireMock. At least that is the goal!
Jswiremock is a flexible http api mocking library.
Right now in v0.4.x:
- Simple requests can be mocked for GET, POST, PUT, PATCH, DELETE and OPTIONS.
- Fixed and Dynamic URL stubs (ex: /account/:varying_var/get/)
- Fixed and Dynamic Query parameters (ex: /account/234234?active=:var&cool=true
- Request body exact matching
$ npm i -s oparaskos-jswiremock
How to use it?
var jswiremocklib= ;var jswiremock = jswiremocklibjswiremock;var stubFor = jswiremocklibstubFor;var get = jswiremocklibget;var post = jswiremocklibpost;var urlEqualTo = jswiremockliburlEqualTo;var aResponse = jswiremocklibaResponse;var stopJSWireMock = jswiremocklibstopJSWireMock;var mockServer = 5001; //port;;/** Actual call to the stub below.*/var request = ;var assert = ;;
Issues or new feature requests
Please feel free to use github's built-in issue tracking feature.