diff --git a/test/api/v3/integration/groups/POST-groups.test.js b/test/api/v3/integration/groups/POST-groups.test.js index f77e0fb5ae..f2ec45b06d 100644 --- a/test/api/v3/integration/groups/POST-groups.test.js +++ b/test/api/v3/integration/groups/POST-groups.test.js @@ -75,8 +75,8 @@ describe('POST /group', () => { context('Parties', () => { it('creates a party', () => { - let groupName = "Test Party"; - let groupType = "party"; + let groupName = 'Test Party'; + let groupType = 'party'; return user.post('/groups', { name: groupName, @@ -86,13 +86,13 @@ describe('POST /group', () => { expect(result._id).to.exist; expect(result.name).to.equal(groupName); expect(result.type).to.equal(groupType); - }) + }); }); it('prevents user in a party from creating another party', () => { let tmpUser; - let groupName = "Test Party"; - let groupType = "party"; + let groupName = 'Test Party'; + let groupType = 'party'; return generateUser().then((generatedUser) => { tmpUser = generatedUser; diff --git a/test/api/v3/integration/tags/GET-tags_id.test.js b/test/api/v3/integration/tags/GET-tags_id.test.js index f8180be5ca..fbdf96312f 100644 --- a/test/api/v3/integration/tags/GET-tags_id.test.js +++ b/test/api/v3/integration/tags/GET-tags_id.test.js @@ -17,7 +17,7 @@ describe('GET /tags/:tagId', () => { return user.post('/tags', {name: 'Tag 1'}) .then((tag) => { createdTag = tag; - return user.get(`/tags/${createdTag._id}`) + return user.get(`/tags/${createdTag._id}`); }) .then((tag) => { expect(tag).to.deep.equal(createdTag); diff --git a/test/api/v3/integration/tasks/GET-tasks.test.js b/test/api/v3/integration/tasks/GET-tasks.test.js index 25bf8b1308..8a191f17bb 100644 --- a/test/api/v3/integration/tasks/GET-tasks.test.js +++ b/test/api/v3/integration/tasks/GET-tasks.test.js @@ -41,5 +41,5 @@ describe('GET /tasks', () => { }); // TODO complete after task scoring is done - it('returns completed todos sorted by creation date if req.query.includeCompletedTodos is specified') + it('returns completed todos sorted by creation date if req.query.includeCompletedTodos is specified'); }); diff --git a/test/api/v3/integration/tasks/POST-tasks.test.js b/test/api/v3/integration/tasks/POST-tasks.test.js index 30e4d3ce37..776e69cad2 100644 --- a/test/api/v3/integration/tasks/POST-tasks.test.js +++ b/test/api/v3/integration/tasks/POST-tasks.test.js @@ -284,7 +284,7 @@ describe('POST /tasks', () => { return user.post('/tasks', { text: 'test reward', type: 'reward', - value: "10", + value: '10', }).then((task) => { expect(task.value).to.eql(10); }); diff --git a/test/api/v3/integration/tasks/POST-tasks_id_score_direction.test.js b/test/api/v3/integration/tasks/POST-tasks_id_score_direction.test.js index 4e21a31b20..2d7e10e745 100644 --- a/test/api/v3/integration/tasks/POST-tasks_id_score_direction.test.js +++ b/test/api/v3/integration/tasks/POST-tasks_id_score_direction.test.js @@ -54,7 +54,7 @@ describe('POST /tasks/:id/score/:direction', () => { it('moves completed todos out of user.tasksOrder.todos', () => { return user.get('/user') .then(user => { - expect(user.tasksOrder.todos.indexOf(todo._id)).to.not.equal(-1) + expect(user.tasksOrder.todos.indexOf(todo._id)).to.not.equal(-1); }).then(() => user.post(`/tasks/${todo._id}/score/up`)) .then(() => user.get(`/tasks/${todo._id}`)) .then((updatedTask) => { @@ -62,14 +62,14 @@ describe('POST /tasks/:id/score/:direction', () => { return user.get('/user'); }) .then((user) => { - expect(user.tasksOrder.todos.indexOf(todo._id)).to.equal(-1) + expect(user.tasksOrder.todos.indexOf(todo._id)).to.equal(-1); }); }); it('moves un-completed todos back into user.tasksOrder.todos', () => { return user.get('/user') .then(user => { - expect(user.tasksOrder.todos.indexOf(todo._id)).to.not.equal(-1) + expect(user.tasksOrder.todos.indexOf(todo._id)).to.not.equal(-1); }).then(() => user.post(`/tasks/${todo._id}/score/up`)) .then(() => user.post(`/tasks/${todo._id}/score/down`)) .then(() => user.get(`/tasks/${todo._id}`)) @@ -242,7 +242,7 @@ describe('POST /tasks/:id/score/:direction', () => { text: 'test plus habit', type: 'habit', down: false, - }) + }); }).then((task) => { plusHabit = task; user.post('/tasks', { @@ -250,7 +250,7 @@ describe('POST /tasks/:id/score/:direction', () => { type: 'habit', up: false, down: false, - }) + }); }).then((task) => { neitherHabit = task; }); diff --git a/test/api/v3/integration/tasks/PUT-tasks_id.test.js b/test/api/v3/integration/tasks/PUT-tasks_id.test.js index 4e5ac308c5..99fdb83615 100644 --- a/test/api/v3/integration/tasks/PUT-tasks_id.test.js +++ b/test/api/v3/integration/tasks/PUT-tasks_id.test.js @@ -127,7 +127,7 @@ describe('PUT /tasks/:id', () => { }); }).then((savedTodo2) => { expect(savedTodo2.checklist.length).to.equal(1); - expect(savedTodo2.checklist[0].text).to.equal("789"); + expect(savedTodo2.checklist[0].text).to.equal('789'); expect(savedTodo2.checklist[0].completed).to.equal(false); }); }); @@ -190,7 +190,7 @@ describe('PUT /tasks/:id', () => { }); }).then((savedDaily2) => { expect(savedDaily2.checklist.length).to.equal(1); - expect(savedDaily2.checklist[0].text).to.equal("789"); + expect(savedDaily2.checklist[0].text).to.equal('789'); expect(savedDaily2.checklist[0].completed).to.equal(false); }); }); @@ -281,7 +281,7 @@ describe('PUT /tasks/:id', () => { it('requires value to be coerced into a number', () => { return user.put(`/tasks/${reward._id}`, { - value: "100", + value: '100', }).then((task) => { expect(task.value).to.eql(100); }); diff --git a/test/api/v3/unit/libs/analyticsService.test.js b/test/api/v3/unit/libs/analyticsService.test.js index 99657b270a..c8536bc887 100644 --- a/test/api/v3/unit/libs/analyticsService.test.js +++ b/test/api/v3/unit/libs/analyticsService.test.js @@ -68,7 +68,7 @@ describe('analyticsService', () => { }); it('sends english item name for gear if itemKey is provided', () => { - data.itemKey = 'headAccessory_special_foxEars' + data.itemKey = 'headAccessory_special_foxEars'; amplitudeNock .filteringPath(/httpapi.*itemName.*Fox%20Ears.*/g, ''); @@ -80,7 +80,7 @@ describe('analyticsService', () => { }); it('sends english item name for egg if itemKey is provided', () => { - data.itemKey = 'Wolf' + data.itemKey = 'Wolf'; amplitudeNock .filteringPath(/httpapi.*itemName.*Wolf%20Egg.*/g, ''); @@ -92,7 +92,7 @@ describe('analyticsService', () => { }); it('sends english item name for food if itemKey is provided', () => { - data.itemKey = 'Cake_Skeleton' + data.itemKey = 'Cake_Skeleton'; amplitudeNock .filteringPath(/httpapi.*itemName.*Bare%20Bones%20Cake.*/g, ''); @@ -104,7 +104,7 @@ describe('analyticsService', () => { }); it('sends english item name for hatching potion if itemKey is provided', () => { - data.itemKey = 'Golden' + data.itemKey = 'Golden'; amplitudeNock .filteringPath(/httpapi.*itemName.*Golden%20Hatching%20Potion.*/g, ''); @@ -116,7 +116,7 @@ describe('analyticsService', () => { }); it('sends english item name for quest if itemKey is provided', () => { - data.itemKey = 'atom1' + data.itemKey = 'atom1'; amplitudeNock .filteringPath(/httpapi.*itemName.*Attack%20of%20the%20Mundane%2C%20Part%201%3A%20Dish%20Disaster!.*/g, ''); @@ -128,7 +128,7 @@ describe('analyticsService', () => { }); it('sends english item name for purchased spell if itemKey is provided', () => { - data.itemKey = 'seafoam' + data.itemKey = 'seafoam'; amplitudeNock .filteringPath(/httpapi.*itemName.*Seafoam.*/g, ''); diff --git a/test/api/v3/unit/libs/buildManifest.test.js b/test/api/v3/unit/libs/buildManifest.test.js index d03e19c9eb..e719d8c434 100644 --- a/test/api/v3/unit/libs/buildManifest.test.js +++ b/test/api/v3/unit/libs/buildManifest.test.js @@ -11,7 +11,7 @@ describe('Build Manifest', () => { }); it('throws an error in case the page does not exist', () => { - let getManifestFilesFn = () => { getManifestFiles('strange name here') }; + let getManifestFilesFn = () => { getManifestFiles('strange name here'); }; expect(getManifestFilesFn).to.throw(Error); }); }); diff --git a/test/api/v3/unit/libs/email.test.js b/test/api/v3/unit/libs/email.test.js index 353ac0ad09..5cfd1b542f 100644 --- a/test/api/v3/unit/libs/email.test.js +++ b/test/api/v3/unit/libs/email.test.js @@ -28,7 +28,7 @@ function getUser () { }, }, }; -}; +} describe('emails', () => { let pathToEmailLib = '../../../../../website/src/libs/api-v3/email'; @@ -97,7 +97,7 @@ describe('emails', () => { delete user.auth['local']; let data = getUserInfo(user, ['name', 'email', '_id', 'canSend']); - + expect(data).to.have.property('name', user.auth.facebook.displayName); expect(data).to.have.property('email', user.auth.facebook.emails[0].value); expect(data).to.have.property('_id', user._id); @@ -109,11 +109,11 @@ describe('emails', () => { let getUserInfo = attachEmail.getUserInfo; let user = getUser(); delete user.profile['name']; - delete user.auth.local['email'] + delete user.auth.local['email']; delete user.auth['facebook']; let data = getUserInfo(user, ['name', 'email', '_id', 'canSend']); - + expect(data).to.have.property('name', user.auth.local.username); expect(data).not.to.have.property('email'); expect(data).to.have.property('_id', user._id); @@ -194,7 +194,7 @@ describe('emails', () => { name: 'my name', email: 'my@email', }; - let variables = [1,2,3]; + let variables = [1, 2, 3]; sendTxnEmail(mailingInfo, emailType, variables); expect(request.post).to.be.calledWith(sinon.match({ @@ -204,8 +204,8 @@ describe('emails', () => { return value[0].name === 'BASE_URL'; }, 'matches variables'), personalVariables: sinon.match((value) => { - return (value[0].rcpt === mailingInfo.email - && value[0].vars[0].name === 'RECIPIENT_NAME' + return (value[0].rcpt === mailingInfo.email + && value[0].vars[0].name === 'RECIPIENT_NAME' && value[0].vars[1].name === 'RECIPIENT_UNSUB_URL' ); }, 'matches personal variables'), diff --git a/test/api/v3/unit/libs/encryption.test.js b/test/api/v3/unit/libs/encryption.test.js index dcab9bffd3..34c159ed02 100644 --- a/test/api/v3/unit/libs/encryption.test.js +++ b/test/api/v3/unit/libs/encryption.test.js @@ -1,4 +1,4 @@ -import { +import { encrypt, decrypt, } from '../../../../../website/src/libs/api-v3/encryption'; diff --git a/test/api/v3/unit/libs/i18n.test.js b/test/api/v3/unit/libs/i18n.test.js index 5bafc201dc..1136f255a6 100644 --- a/test/api/v3/unit/libs/i18n.test.js +++ b/test/api/v3/unit/libs/i18n.test.js @@ -34,7 +34,7 @@ describe('i18n', () => { describe('localePath', () => { it('is an absolute path to common/locales/', () => { expect(localePath).to.match(/.*\/common\/locales\//); - expect(localePath) + expect(localePath); }); }); diff --git a/test/api/v3/unit/middlewares/analytics.test.js b/test/api/v3/unit/middlewares/analytics.test.js index e2808bc881..cc09c8f39a 100644 --- a/test/api/v3/unit/middlewares/analytics.test.js +++ b/test/api/v3/unit/middlewares/analytics.test.js @@ -3,10 +3,10 @@ import { generateReq, generateNext, } from '../../../../helpers/api-unit.helper'; -import analyticsService from '../../../../../website/src/libs/api-v3/analyticsService' +import analyticsService from '../../../../../website/src/libs/api-v3/analyticsService'; import nconf from 'nconf'; -describe('analytics middleware', function() { +describe('analytics middleware', function () { let res, req, next; let pathToAnalyticsMiddleware = '../../../../../website/src/middlewares/api-v3/analytics'; @@ -23,7 +23,7 @@ describe('analytics middleware', function() { delete require.cache[require.resolve(pathToAnalyticsMiddleware)]; }); - it('attaches analytics object res.locals', function() { + it('attaches analytics object res.locals', function () { let attachAnalytics = require(pathToAnalyticsMiddleware); attachAnalytics(req, res, next); diff --git a/test/api/v3/unit/middlewares/getUserLanguage.test.js b/test/api/v3/unit/middlewares/getUserLanguage.test.js index 1ee185915b..94693e6713 100644 --- a/test/api/v3/unit/middlewares/getUserLanguage.test.js +++ b/test/api/v3/unit/middlewares/getUserLanguage.test.js @@ -121,7 +121,7 @@ describe('getUserLanguage', () => { context('request with session', () => { it('uses the user preferred language if avalaible', (done) => { sandbox.stub(User, 'findOne').returns({ - exec() { + exec () { return Q.resolve({ preferences: { language: 'it', diff --git a/test/api/v3/unit/middlewares/response.js b/test/api/v3/unit/middlewares/response.js index ca3d160908..15bb9881a5 100644 --- a/test/api/v3/unit/middlewares/response.js +++ b/test/api/v3/unit/middlewares/response.js @@ -3,9 +3,9 @@ import { generateReq, generateNext, } from '../../../../helpers/api-unit.helper'; -import responseMiddleware from '../../../../../website/src/middlewares/api-v3/response' +import responseMiddleware from '../../../../../website/src/middlewares/api-v3/response'; -describe('response middleware', function() { +describe('response middleware', function () { let res, req, next; beforeEach(() => { @@ -15,13 +15,13 @@ describe('response middleware', function() { }); - it('attaches respond method to res', function() { + it('attaches respond method to res', function () { responseMiddleware(req, res, next); expect(res.respond).to.exist; }); - it('can be used to respond to requests', function() { + it('can be used to respond to requests', function () { responseMiddleware(req, res, next); res.respond(200, {field: 1}); @@ -34,7 +34,7 @@ describe('response middleware', function() { }); }); - it('treats status >= 400 as failures', function() { + it('treats status >= 400 as failures', function () { responseMiddleware(req, res, next); res.respond(403, {field: 1});