patch to remove timeout from login test

This commit is contained in:
Sorrel Bri 2020-01-15 11:28:40 -08:00 committed by sorrelbri
parent 68ae8615f3
commit a5bee4129b
2 changed files with 2 additions and 4 deletions

View file

@ -36,7 +36,7 @@ const login = async (req, res, next) => {
const queryResults = await knex('user') const queryResults = await knex('user')
.where({username: user.username}) .where({username: user.username})
.select('username', 'email', 'password') .select()
.then(queryResults => queryResults); .then(queryResults => queryResults);
const savedUser = queryResults[0] || null; const savedUser = queryResults[0] || null;
@ -44,7 +44,6 @@ const login = async (req, res, next) => {
const hashedPassword = savedUser.password; const hashedPassword = savedUser.password;
const passwordMatch = await compareHash(user.password, hashedPassword); const passwordMatch = await compareHash(user.password, hashedPassword);
if (!passwordMatch) return res.status(401).json({err: 'bad credentials'}); if (!passwordMatch) return res.status(401).json({err: 'bad credentials'});
const authorizedUser = {...savedUser}; const authorizedUser = {...savedUser};

View file

@ -87,8 +87,7 @@ const authSpec = (chai, knex, server) => {
}) })
}) })
it('post to login with registered user should return cookie', function(done) { it('post to login with registered user should return cookie', done => {
this.timeout(5000);
chai.request(server) chai.request(server)
.post('/auth/signup') .post('/auth/signup')
.type('form') .type('form')