lint: Fix tests that can be fixed with the eslint --fix flag

This commit is contained in:
Blade Barringer
2015-12-30 21:16:26 -06:00
parent 6f220c6869
commit 70151fd073
14 changed files with 41 additions and 41 deletions

View File

@@ -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;

View File

@@ -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);

View File

@@ -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');
});

View File

@@ -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);
});

View File

@@ -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;
});

View File

@@ -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);
});

View File

@@ -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, '');

View File

@@ -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);
});
});

View File

@@ -28,7 +28,7 @@ function getUser () {
},
},
};
};
}
describe('emails', () => {
let pathToEmailLib = '../../../../../website/src/libs/api-v3/email';
@@ -109,7 +109,7 @@ 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']);

View File

@@ -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);
});
});

View File

@@ -3,7 +3,7 @@ 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 () {

View File

@@ -3,7 +3,7 @@ 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 () {
let res, req, next;