lint: Fix tests that can be fixed with the eslint --fix flag
This commit is contained in:
@@ -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, '');
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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'),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {
|
||||
import {
|
||||
encrypt,
|
||||
decrypt,
|
||||
} from '../../../../../website/src/libs/api-v3/encryption';
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user