fix test lint

This commit is contained in:
Matteo Pagliazzi
2019-10-08 20:45:38 +02:00
parent e37f4467f8
commit 85fb5f33aa
367 changed files with 6635 additions and 6080 deletions
+9 -9
View File
@@ -20,19 +20,19 @@ describe('shared.ops.allocate', () => {
});
});
it('throws an error if an invalid attribute is supplied', (done) => {
it('throws an error if an invalid attribute is supplied', done => {
try {
allocate(user, {
query: {stat: 'notValid'},
query: { stat: 'notValid' },
});
} catch (err) {
expect(err).to.be.an.instanceof(BadRequest);
expect(err.message).to.equal(errorMessage('invalidAttribute', {attr: 'notValid'}));
expect(err.message).to.equal(errorMessage('invalidAttribute', { attr: 'notValid' }));
done();
}
});
it('throws an error if the user is below lvl 10', (done) => {
it('throws an error if the user is below lvl 10', done => {
user.stats.lvl = 9;
try {
allocate(user);
@@ -43,7 +43,7 @@ describe('shared.ops.allocate', () => {
}
});
it('throws an error if the user hasn\'t selected class', (done) => {
it('throws an error if the user hasn\'t selected class', done => {
user.flags.classSelected = false;
try {
allocate(user);
@@ -54,7 +54,7 @@ describe('shared.ops.allocate', () => {
}
});
it('throws an error if the user has disabled classes', (done) => {
it('throws an error if the user has disabled classes', done => {
user.preferences.disableClasses = true;
try {
allocate(user);
@@ -65,7 +65,7 @@ describe('shared.ops.allocate', () => {
}
});
it('throws an error if the user doesn\'t have attribute points', (done) => {
it('throws an error if the user doesn\'t have attribute points', done => {
try {
allocate(user);
} catch (err) {
@@ -85,7 +85,7 @@ describe('shared.ops.allocate', () => {
it('allocates attribute points', () => {
expect(user.stats.con).to.equal(0);
user.stats.points = 1;
allocate(user, {query: {stat: 'con'}});
allocate(user, { query: { stat: 'con' } });
expect(user.stats.con).to.equal(1);
expect(user.stats.points).to.equal(0);
});
@@ -94,7 +94,7 @@ describe('shared.ops.allocate', () => {
expect(user.stats.int).to.equal(0);
expect(user.stats.mp).to.equal(10);
user.stats.points = 1;
allocate(user, {query: {stat: 'int'}});
allocate(user, { query: { stat: 'int' } });
expect(user.stats.int).to.equal(1);
expect(user.stats.mp).to.equal(11);
});
+8 -8
View File
@@ -20,7 +20,7 @@ describe('shared.ops.allocateBulk', () => {
});
});
it('throws an error if an invalid attribute is supplied', (done) => {
it('throws an error if an invalid attribute is supplied', done => {
try {
allocateBulk(user, {
body: {
@@ -32,12 +32,12 @@ describe('shared.ops.allocateBulk', () => {
});
} catch (err) {
expect(err).to.be.an.instanceof(BadRequest);
expect(err.message).to.equal(errorMessage('invalidAttribute', {attr: 'invalid'}));
expect(err.message).to.equal(errorMessage('invalidAttribute', { attr: 'invalid' }));
done();
}
});
it('throws an error if the stats are not supplied', (done) => {
it('throws an error if the stats are not supplied', done => {
try {
allocateBulk(user);
} catch (err) {
@@ -47,7 +47,7 @@ describe('shared.ops.allocateBulk', () => {
}
});
it('throws an error if the user is below lvl 10', (done) => {
it('throws an error if the user is below lvl 10', done => {
user.stats.lvl = 9;
try {
allocateBulk(user, {
@@ -65,7 +65,7 @@ describe('shared.ops.allocateBulk', () => {
}
});
it('throws an error if the user hasn\'t selected class', (done) => {
it('throws an error if the user hasn\'t selected class', done => {
user.flags.classSelected = false;
try {
allocateBulk(user, {
@@ -83,7 +83,7 @@ describe('shared.ops.allocateBulk', () => {
}
});
it('throws an error if the user has disabled classes', (done) => {
it('throws an error if the user has disabled classes', done => {
user.preferences.disableClasses = true;
try {
allocateBulk(user, {
@@ -101,7 +101,7 @@ describe('shared.ops.allocateBulk', () => {
}
});
it('throws an error if the user doesn\'t have attribute points', (done) => {
it('throws an error if the user doesn\'t have attribute points', done => {
try {
allocateBulk(user, {
body: {
@@ -118,7 +118,7 @@ describe('shared.ops.allocateBulk', () => {
}
});
it('throws an error if the user doesn\'t have enough attribute points', (done) => {
it('throws an error if the user doesn\'t have enough attribute points', done => {
user.stats.points = 1;
try {
allocateBulk(user, {
+1 -1
View File
@@ -18,7 +18,7 @@ describe('shared.ops.allocateNow', () => {
user.stats.str = 9;
user.preferences.allocationMode = 'flat';
let [data] = allocateNow(user);
const [data] = allocateNow(user);
expect(user.stats.points).to.equal(0);
expect(user.stats.con).to.equal(9);