Skip to content
Permalink
Browse files
Fixed all linter warnings & uncovered test lines
  • Loading branch information
pastorpv committed Dec 1, 2019
1 parent c2c4ec3 commit cdac24f7d14aa1a3da3d1e1ebb40bf612110d1cc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
@@ -254,8 +254,8 @@ router.post('/addComment', async ctx => {
try {
const body = ctx.request.body
await comments.comments(ctx.session.user, body.comments, body.genretitle, body.genre)
ctx.body = ""
return;
ctx.body = ''
return

} catch (err) {
console.log(err)
@@ -266,8 +266,8 @@ router.post('/addComment', async ctx => {
router.post('/deleteComment', async ctx => {
try {
await comments.deleteComments(ctx.request.body.commentID)
ctx.body = ""
return;
ctx.body = ''
return
} catch (err) {
console.log(err)
await ctx.render('error', { message: err.message })
@@ -21,8 +21,6 @@ module.exports = class Search {

searchResult.forEach(async result => this.insertRatings(result, 'audio_ratings', 'uploadId', user))
}



return searchResult
}
@@ -8,6 +8,13 @@ describe('search()', () => {
await expect(search.search({q: 'test'}, 'default')).resolves.toEqual([])
done()
})

test('invalid search, q is undefined', async done => {
expect.assertions(1)
const search = await new Search(await new Database())
await expect(search.search({q: undefined}, 'default')).resolves.toBeUndefined()
done()
})
})

describe('sum()', () => {

0 comments on commit cdac24f

Please sign in to comment.