1.0.2 • Published 6 years ago

mountebank-util v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

Stub backend API with mountebank interface for client end to end test


How to Install

npm install -g mountebank

Type below command to run mountebank server

mb
npm install --save mountebank-util

How to Use

var Mountebank = require('mountebank-util')
var stubServer = new Mountebank('port-number')

//To stub api /hello
stubServer.addResponse('/hello', 'GET', 'return value')
stubServer.createImposter()

//To remove stub
stubServer.deleteImposter()

Methods

NameParameterDescription
constructorport: Default) 9000Instantiate stub server on specified port
addResponseuri: URI to the API ex) '/hello'method: Rest methods ex) 'GET, POST...'content: Return objectstatusCode: Default) 200Configure specified URI to return object
updateResponseuri: URI to the API to be updatedmethod: Rest methodsnewResponseBody: Return objectUpdate specified API stub to return different object
createImposternoneOpen stub server
deleteImposternoneClose stub server