If I have the following route:
app.post('/', (req, res, next) => {
req.flash('errors', 'error');
return res.redirect('/');
});
And the following supertest test:
describe('POST /', () => {
it('should return a flash error', (done) => {
request(app)
.post('/')
.expect('Location', '/')
.expect(302)
.end((err, res) => {
console.log(res);
});
});
});
How can I verify the flash value? I logged the response and I can't find where they are stored. I found online that it might be in the body or text, but they are both empty. Is there another way? If it can help, I'm using this boilerplate with most things as it is.