Setting cookies on requests

26 views
Skip to first unread message

cambiph

unread,
Jun 28, 2016, 2:32:01 AM6/28/16
to Chai.js
Hey,

Does anyone have any idea on how to set a cookie on the request?
I have got the 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);
});


I want to add a cookie to the chau.request() but I can't seem to find it.
I tried to use the send()-function but that doesn't seem to work.
Any thoughts would be greatly appreciated.

Thanks in advance.
Cheers
Reply all
Reply to author
Forward
0 new messages