Skip to content
This repository has been archived by the owner. It is now read-only.
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Co Retest

NPM version Build status Test coverage Gittip Greenkeeper badge

Simple wrapper for the retest library for co-like interfaces (node.js generators) using thunks.

Currently you must use the --harmony-generators flag when running node 0.11.x to get access to generators.

Installation

npm install co-retest --save-dev

Usage

You may pass a http.Server, function or string to retest() - if the server is not listening for connections it will be bound to an ephemeral port so there is no need to keep track of ports.

var co      = require('co');
var retest  = require('co-retest');
var express = require('express');

var app = express();

app.get('/', function (req, res) {
  res.send('hello');
});

co(function* () {
  var res = yield retest(app).get('/');

  console.log('Body: ' + res.body);
  console.log('Status: ' + res.statusCode);
})();

All API methods from retest work as usual, but every method returns a thunkified version of request for use with co.

Please note: The thunkified function return can be called multiple times to get multiple results.

License

MIT

About

Simple wrapper for the retest library for co-like interfaces (node.js generators)

Resources

License

Sponsor this project

 
Learn more about GitHub Sponsors
You can’t perform that action at this time.