constructor(port, responseFormat) |
port, any or number , default is 4000 , string 'text' or 'json' (default json) |
get(path, response, errorResponse, assertRequestBody, requestBody) |
path: string example: '/foo'; response: object or string - path to json file or string response, three last args is optiona, if you want own response error errorResponse object , assertRequestBody bool if true your response body will be assert equal with last arg requestBody object |
post(path, response, errorResponse, assertRequestBody, requestBody) |
path: string example: '/foo'; response: object or string - path to json file or string response, three last args is optiona, if you want own response error errorResponse object , assertRequestBody bool if true your response body will be assert equal with last arg requestBody object |
del(path, response, errorResponse, assertRequestBody, requestBody) |
path: string example: '/foo'; response: object or string - path to json file or string response, three last args is optiona, if you want own response error errorResponse object , assertRequestBody bool if true your response body will be assert equal with last arg requestBody object |
put(path, response, errorResponse, assertRequestBody, requestBody) |
path: string example: '/foo'; response: object or string - path to json file or string response, three last args is optiona, if you want own response error errorResponse object , assertRequestBody bool if true your response body will be assert equal with last arg requestBody object |
start() |
any args |
getDelResult(path) |
path: string example '/foo', if server dont have action for this path return empty obj |
getPutResult(path) |
path: string example '/foo', if server dont have action for this path return empty obj |
getGetResult(path) |
path: string example '/foo', if server dont have action for this path return empty obj |
getPostResult(path) |
path: string example '/foo', if server dont have action for this path return empty obj |
stop() |
any args, if server not started - will get message, after stop you can get actions results etc |
restore() |
any args, server to initial conditions, if server runned it method stop it |
calledWithArg(arg) |
called from result of action, arg object return true if you call this path with arg |
## don`t need any dependencies |
|