Jump to Content
MaddoxWhat Is MaddoxAPI DocsDiscussions
HomeWhat Is MaddoxAPI DocsChangelogDiscussions
What Is MaddoxAPI DocsDiscussionsLog InMaddox
API Docs
Log In

Scenarios

  • What Are Scenarios?
  • HttpRequestScenario
  • FromCallbackScenario
  • FromPromiseScenario
  • FromSynchronousScenario

Constants

  • IgnoreParam
  • EmptyResult
  • EmptyParameters

API

  • mockThisFunction
  • withEntryPoint
  • withInputParams
  • withTestFinisherFunction
  • shouldBeCalledWith
  • shouldAlwaysBeCalledWith
  • shouldAlwaysBeIgnored
  • doesReturn
  • doesAlwaysReturn
  • doesReturnWithPromise
  • doesAlwaysReturnWithPromise
  • doesReturnWithCallback
  • doesAlwaysReturnWithCallback
  • doesError
  • doesErrorWithPromise
  • doesErrorWithCallback
  • noDebug
  • test

HttpReqScenario API

  • withHttpRequest
  • resShouldBeCalledWith
  • resShouldAlwaysBeCalledWith
  • resShouldContainHeader
  • resShouldAlwaysBeIgnored
  • resDoesReturn
  • resDoesAlwaysReturn
  • resDoesReturnSelf

Compare

  • What is Maddox.compare
  • shouldEqual
  • shouldBeTruthy
  • shouldBeFalsy
  • shouldBeFalsey
  • equal
  • truthy
  • falsey
  • shouldBeUnreachable
  • shouldbeSubset
  • subset
Powered by 

withHttpRequest

withHttpRequest(request)

Provides same functionality as 'withInputParams' but it provides a lexical name that matches the HttpReqScenario.

  • request {Object} - An object representing the structure of a Node HttpRequest. Most common things to add are 'body', 'params', 'query', etc. But you can put anything you'd like into this object.
  • returns {Scenario}
  • Table of Contents
    • withHttpRequest(request)