Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Virile testing for http servers or any nodejs application.
JavaScript
tree: eb9c2660b3

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
example
lib
Readme.md
index.js
package.json

Readme.md

✿ Testosterone

Easy testing for virile http servers.

Testosterone is built on nodejs but it allows you to test any http server.

Installation

npm install testosterone

How does it work?

Call testosterone with two optional options:

  • host (localhost)
  • port (80)

Use the returned object to do http calls with a sinatra-like-chainable syntax.

If you want the virilest experiencie, replace nodejs assert with testosterone.assert

Show me the code

Example:

var testosterone = require('testosterone')({post: 3000}),
    assert = testosterone.assert;

testosterone
  .get('/', function (res) {
    assert.equal(res.statusCode, 200)
  })

  .get('/hi', function (res) {
    assert.equal(res.statusCode, 500);
    assert.equal(res.body, 'use post instead');
  })

  .post('/hi', {data: {message: 'hola'}}, {
    status: 200,
    body: 'hola'
  });

Then you run it:

$ node example/test.js

✿ Testosterone
✓ ✓ ✓ ✓ ✓
» 3 responses, 5 asserts

Credits

The core of this library is a shameless copy from expresso response assert done by TJ Holowaychuk (visionmedia)

Something went wrong with that request. Please try again.