Skip to content
Virile testing for http servers or any nodejs application. http://masylum.github.com/testosterone
JavaScript
Find file
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

Options

Testosterone accepts two options:

  • host (localhost)
  • port (80)

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.