Open kazkondo opened 6 years ago
Hey @kazkondo, and thanks for reporting this!
It sounds like we may have another async problem, ala https://github.com/rjz/supertest-session/issues/28. Before we cook up a test case, could you confirm:
supertest
and supertest-session
, and also thatit('/member/profile', (done) => {
authenticatedSession.get('/member/profile')
.expect(200)
.end((err) => {
console.log('Yep, definitely broken.');
done(err);
});
});
@rjz I have a similar condition. to answer your clarification, there is no Yep, definitely broken.
logged, but the error thrown is TypeError: Cannot read property 'expect' of undefined
.
authenticatedSession
logs as the testSession
as you would expect, in the beforeEach hook.
UDPATE:
my variable testSession
was moved to the global scope next to const myApp = require('/myAppPath')
as let testSession = session(myApp)
and now its 👌
Written by Typescript, but executed as javascript with jest