Supertest lets you call done inside of an expect call instead of calling .end(done). When you use supertest-session to do this, you cannot chain methods. For example, when you try something like this:
var request = require('supertest-session');
var user = request(app)
.post('/login')
.type('form')
.send(credentials)
.expect(302, done);
It does not chain correctly, and you need to instead use:
var request = require('supertest-session');
var user = request(app);
user
.post('/login')
.type('form')
.send(credentials)
.expect(302, done);
Supertest lets you call done inside of an expect call instead of calling .end(done). When you use supertest-session to do this, you cannot chain methods. For example, when you try something like this:
It does not chain correctly, and you need to instead use: