Skip to content

djungowski/jasmine-supertest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 jasmine/jasmine-npm#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));
    });
});

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published