Consider following code:
it('Test logout', function (done) {
async.each(config.www, function (url, callback) {
var healthCheck = url + '/'
chai.request(url).get('/')
.then(function (res) {
expect(res, healthCheck).to.have.status(200);
expect(res.text.indexOf(url + '/logout?type=user">Log out</a>'), 'Logout is incorrect').to.be.greaterThan(0);
callback();
})
.catch(function (err) {
callback(err);
})
}, done);
});
The problem is that I need to set a cookie to bypass a splash-page. Any ideas on how I can achieve this?