Skip to content

Commit

Permalink
PR required fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
memphisdj committed Apr 21, 2021
1 parent 44acdb7 commit f1eacb4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 0 additions & 2 deletions routes/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ router.post(
let pass = null
if (req.body.password) {
pass = bcrypt.hashSync(req.body.password, 10)
} else {
pass = null
}

const user = await User.create({
Expand Down
3 changes: 2 additions & 1 deletion tests/tests.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { User, Item } = require('../models/index')
const bcrypt = require('bcrypt')

beforeAll(async () => {
await User.destroy({ where: {} })
Expand All @@ -8,7 +9,7 @@ test('Creates a user', async () => {
const user = await User.create({
username: 'admin',
email: '[email protected]',
password: 'admin'
password: bcrypt.hashSync('admin', 10)
})

expect(user.username).toBe('admin')
Expand Down

0 comments on commit f1eacb4

Please sign in to comment.