1.0.0 • Published 8 years ago

jasmine-supertest v1.0.0

Weekly downloads
1,216
License
ISC
Repository
github
Last release
8 years ago

jasmine-supertest

Build Status

Small library to ease the pain of using SuperTest in combination with Jasmine

If you use Supertest in combination with Jasmine, you cannot use the done callback out-of-the-box (see https://github.com/jasmine/jasmine-npm/issues/31). This library eases this pain.

Installation

npm install jasmine-supertest

Usage

jasmine-supertest simply adds a wrapper function you can use to finish SuperTest testcases. Instead of writing .end(done) you simply have to call finishTestcase(done).

var server = require('../lib/server');
var supertest = require('supertest');
var finishTestcase = require('jasmine-supertest');

describe('jasmine-supertest test suite', function() {
    it('calls done without any params and finishes the test case is fine', function(done) {
		    var app = supertest(server);
		    app.get('/incorrect-url').expect(404).end(finishTestcase(doneMock));
    });
});