router.get('/logout', function (req, res)
{
req.logout();
req.session = null;
res.redirect('/login');
});
错误->本地主机未发送任何数据! 我曾经尝试过所有解决方案,但仍然无法获得预期的输出!
感谢任何帮助!
答案 0 :(得分:-1)
使用快速会话模块,您可以:
it('should get current user', async () => {
const result = service.getCurrentUser();
console.log('RESULT', result);
const req = httpMock.expectOne(`/api/me`);
const test = req.flush({test: 'ing'});
console.log('REQUEST', test);
expect('a').toEqual('a');
});