JSPM

mountebank

0.1.209
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 23972
  • Score
    100M100P100Q134436F
  • License MIT

Over the wire test doubles

Package Exports

  • mountebank

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mountebank) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

mountebank

mountebank is the first tool to provide multi-protocol, multi-language test doubles over the wire. Just point your application to mountebank instead of the real dependency, and test like you would with traditional stubs and mocks.

At the moment, the following protocols are supported:

  • http
  • https
  • tcp
  • smtp

Getting Started

NPM version

Install:

npm install -g mountebank

Run:

mb

Create a test double:

cat << EOF > imposter.json
  {
    "port": 2526,
    "protocol": "http",
    "stubs": [{
      "responses": [
        { "is": { "statusCode": 400 }}
      ],
      "predicates": {
        "path": { "is": "/test" },
        "method": { "is": "POST" },
        "body": { "not": { "contains": "requiredField" } },
        "headers": {
          "Content-Type": { "is": "application/json" }
        }
      }
    }]
  }
EOF

curl -i -H 'Content-Type: application/json' -d@imposter.json http://localhost:2525/imposters

Learn More

After installing, open your browser to http://localhost:2525, or visit the public site.

Support

Visit the Google group for any support questions. Don't be shy!

Building

Build Status Coverage Status Dependency Status

./build should do the trick. If not, yell at me. At the moment I've tested on OS X and Linux. I test on node 0.10 (I used to test on node 0.8 as well, but struggled getting my Travis deployments working with both in the build matrix).

Contributing

Contributions are welcome (see TODO.md for my own open loops, although I welcome other ideas). Some tips for contributing are in the contributing link that spins up when you run mb. You can reach me at brandon.byars@gmail.com.