I have the following session setup...
setupSession(){
const session = {
secret: process.env.SESSION_SECRET,
cookie: {},
resave: false,
saveUninitialized: false,
};
this.app.use(expressSession(session));
}
I have the following test...
it("User should pass", (done)=>{
supertest(app)
.get("/user")
.set('Cookie', ['connect.sid=...'])
.expect(200)
.end(function(err, res){
if (err) done(err);
done();
});
})
I now need to mock out a session in the app to make sure that the login is valid? How do I mock a session in the session store so it thinks it is logged in during supertests?