(chore): lint test/common files

This commit is contained in:
Blade Barringer
2015-11-19 20:27:39 -06:00
parent bdf1c82b39
commit 776faddb34
11 changed files with 1368 additions and 1351 deletions

View File

@@ -1,53 +1,59 @@
var expect;
/* eslint-disable prefer-template, no-shadow, func-names */
expect = require('expect.js');
let expect = require('expect.js');
module.exports.addCustomMatchers = function () {
let Assertion;
module.exports.addCustomMatchers = function() {
var Assertion;
Assertion = expect.Assertion;
Assertion.prototype.toHaveGP = function(gp) {
var actual;
Assertion.prototype.toHaveGP = function (gp) {
let actual;
actual = this.obj.stats.gp;
return this.assert(actual === gp, function() {
return "expected user to have " + gp + " gp, but got " + actual;
}, function() {
return "expected user to not have " + gp + " gp";
return this.assert(actual === gp, () => {
return 'expected user to have ' + gp + ' gp, but got ' + actual;
}, () => {
return 'expected user to not have ' + gp + ' gp';
});
};
Assertion.prototype.toHaveHP = function(hp) {
var actual;
Assertion.prototype.toHaveHP = function (hp) {
let actual;
actual = this.obj.stats.hp;
return this.assert(actual === hp, function() {
return "expected user to have " + hp + " hp, but got " + actual;
}, function() {
return "expected user to not have " + hp + " hp";
return this.assert(actual === hp, () => {
return 'expected user to have ' + hp + ' hp, but got ' + actual;
}, () => {
return 'expected user to not have ' + hp + ' hp';
});
};
Assertion.prototype.toHaveExp = function(exp) {
var actual;
Assertion.prototype.toHaveExp = function (exp) {
let actual;
actual = this.obj.stats.exp;
return this.assert(actual === exp, function() {
return "expected user to have " + exp + " experience points, but got " + actual;
}, function() {
return "expected user to not have " + exp + " experience points";
return this.assert(actual === exp, () => {
return 'expected user to have ' + exp + ' experience points, but got ' + actual;
}, () => {
return 'expected user to not have ' + exp + ' experience points';
});
};
Assertion.prototype.toHaveLevel = function(lvl) {
var actual;
Assertion.prototype.toHaveLevel = function (lvl) {
let actual;
actual = this.obj.stats.lvl;
return this.assert(actual === lvl, function() {
return "expected user to be level " + lvl + ", but got " + actual;
}, function() {
return "expected user to not be level " + lvl;
return this.assert(actual === lvl, () => {
return 'expected user to be level ' + lvl + ', but got ' + actual;
}, () => {
return 'expected user to not be level ' + lvl;
});
};
return Assertion.prototype.toHaveMaxMP = function(mp) {
var actual;
Assertion.prototype.toHaveMaxMP = function (mp) {
let actual;
actual = this.obj._statsComputed.maxMP;
return this.assert(actual === mp, function() {
return "expected user to have " + mp + " max mp, but got " + actual;
}, function() {
return "expected user to not have " + mp + " max mp";
return this.assert(actual === mp, () => {
return 'expected user to have ' + mp + ' max mp, but got ' + actual;
}, () => {
return 'expected user to not have ' + mp + ' max mp';
});
};
};