[misc] fix prettier-eslint errors

This commit is contained in:
Jakob Ackermann 2020-02-11 10:08:35 +01:00
parent f901064a59
commit 00e15a383f
3 changed files with 40 additions and 31 deletions

View file

@ -124,7 +124,6 @@ module.exports = Notifications = {
return db.notifications.remove(searchOps, { justOne: true }, callback) return db.notifications.remove(searchOps, { justOne: true }, callback)
} }
} }
;['getUserNotifications', 'addNotification'].map(method => ;['getUserNotifications', 'addNotification'].map(method =>
metrics.timeAsyncMethod(Notifications, method, 'mongo.Notifications', logger) metrics.timeAsyncMethod(Notifications, method, 'mongo.Notifications', logger)
) )

View file

@ -44,8 +44,8 @@ describe('Notifications Controller', function() {
]) ])
}) })
describe('getUserNotifications', () => describe('getUserNotifications', function() {
it('should ask the notifications for the users notifications', function(done) { return it('should ask the notifications for the users notifications', function(done) {
this.notifications.getUserNotifications = sinon this.notifications.getUserNotifications = sinon
.stub() .stub()
.callsArgWith(1, null, this.stubbedNotification) .callsArgWith(1, null, this.stubbedNotification)
@ -63,10 +63,11 @@ describe('Notifications Controller', function() {
return done() return done()
} }
}) })
})) })
})
describe('addNotification', () => describe('addNotification', function() {
it('should tell the notifications to add the notification for the user', function(done) { return it('should tell the notifications to add the notification for the user', function(done) {
this.notifications.addNotification = sinon.stub().callsArgWith(2) this.notifications.addNotification = sinon.stub().callsArgWith(2)
const req = { const req = {
params: { params: {
@ -82,10 +83,11 @@ describe('Notifications Controller', function() {
return done() return done()
} }
}) })
})) })
})
describe('removeNotificationId', () => describe('removeNotificationId', function() {
it('should tell the notifications to mark the notification Id as read', function(done) { return it('should tell the notifications to mark the notification Id as read', function(done) {
this.notifications.removeNotificationId = sinon.stub().callsArgWith(2) this.notifications.removeNotificationId = sinon.stub().callsArgWith(2)
const req = { const req = {
params: { params: {
@ -101,10 +103,11 @@ describe('Notifications Controller', function() {
return done() return done()
} }
}) })
})) })
})
describe('removeNotificationKey', () => describe('removeNotificationKey', function() {
it('should tell the notifications to mark the notification Key as read', function(done) { return it('should tell the notifications to mark the notification Key as read', function(done) {
this.notifications.removeNotificationKey = sinon.stub().callsArgWith(2) this.notifications.removeNotificationKey = sinon.stub().callsArgWith(2)
const req = { const req = {
params: { params: {
@ -120,10 +123,11 @@ describe('Notifications Controller', function() {
return done() return done()
} }
}) })
})) })
})
return describe('removeNotificationByKeyOnly', () => return describe('removeNotificationByKeyOnly', function() {
it('should tell the notifications to mark the notification Key as read', function(done) { return it('should tell the notifications to mark the notification Key as read', function(done) {
this.notifications.removeNotificationByKeyOnly = sinon this.notifications.removeNotificationByKeyOnly = sinon
.stub() .stub()
.callsArgWith(1) .callsArgWith(1)
@ -140,5 +144,6 @@ describe('Notifications Controller', function() {
return done() return done()
} }
}) })
})) })
})
}) })

View file

@ -71,8 +71,8 @@ describe('Notifications Tests', function() {
return (this.stubbedNotificationArray = [this.stubbedNotification]) return (this.stubbedNotificationArray = [this.stubbedNotification])
}) })
describe('getUserNotifications', () => describe('getUserNotifications', function() {
it('should find all notifications and return i', function(done) { return it('should find all notifications and return i', function(done) {
this.findStub.callsArgWith(1, null, this.stubbedNotificationArray) this.findStub.callsArgWith(1, null, this.stubbedNotificationArray)
return this.notifications.getUserNotifications( return this.notifications.getUserNotifications(
user_id, user_id,
@ -85,7 +85,8 @@ describe('Notifications Tests', function() {
return done() return done()
} }
) )
})) })
})
describe('addNotification', function() { describe('addNotification', function() {
beforeEach(function() { beforeEach(function() {
@ -234,8 +235,8 @@ describe('Notifications Tests', function() {
}) })
}) })
describe('removeNotificationId', () => describe('removeNotificationId', function() {
it('should mark the notification id as read', function(done) { return it('should mark the notification id as read', function(done) {
this.updateStub.callsArgWith(2, null) this.updateStub.callsArgWith(2, null)
return this.notifications.removeNotificationId( return this.notifications.removeNotificationId(
@ -254,10 +255,11 @@ describe('Notifications Tests', function() {
return done() return done()
} }
) )
})) })
})
describe('removeNotificationKey', () => describe('removeNotificationKey', function() {
it('should mark the notification key as read', function(done) { return it('should mark the notification key as read', function(done) {
this.updateStub.callsArgWith(2, null) this.updateStub.callsArgWith(2, null)
return this.notifications.removeNotificationKey( return this.notifications.removeNotificationKey(
@ -276,10 +278,11 @@ describe('Notifications Tests', function() {
return done() return done()
} }
) )
})) })
})
describe('removeNotificationByKeyOnly', () => describe('removeNotificationByKeyOnly', function() {
it('should mark the notification key as read', function(done) { return it('should mark the notification key as read', function(done) {
this.updateStub.callsArgWith(2, null) this.updateStub.callsArgWith(2, null)
return this.notifications.removeNotificationByKeyOnly( return this.notifications.removeNotificationByKeyOnly(
@ -292,10 +295,11 @@ describe('Notifications Tests', function() {
return done() return done()
} }
) )
})) })
})
return describe('deleteNotificationByKeyOnly', () => return describe('deleteNotificationByKeyOnly', function() {
it('should completely remove the notification', function(done) { return it('should completely remove the notification', function(done) {
this.removeStub.callsArgWith(2, null) this.removeStub.callsArgWith(2, null)
return this.notifications.deleteNotificationByKeyOnly( return this.notifications.deleteNotificationByKeyOnly(
@ -308,5 +312,6 @@ describe('Notifications Tests', function() {
return done() return done()
} }
) )
})) })
})
}) })