mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
Fix: lint
This commit is contained in:
@@ -13,19 +13,23 @@ describe('getDebuffPotionItems', () => {
|
|||||||
user = generateUser();
|
user = generateUser();
|
||||||
});
|
});
|
||||||
|
|
||||||
for (let key in TRANSFORMATION_DEBUFFS_LIST) {
|
for (const key in TRANSFORMATION_DEBUFFS_LIST) {
|
||||||
const debuff = TRANSFORMATION_DEBUFFS_LIST[key];
|
if (Object.prototype.hasOwnProperty.call(TRANSFORMATION_DEBUFFS_LIST, key)) {
|
||||||
// Here we itterate whole object to dynamicaly create test suites as it described in dock of mocha
|
const debuff = TRANSFORMATION_DEBUFFS_LIST[key];
|
||||||
// https://mochajs.org/#dynamically-generating-tests
|
// Here we itterate whole object to dynamicaly create test suites as
|
||||||
// That's why we have eslint-disable here
|
// it described in dock of mocha
|
||||||
// eslint-disable-next-line no-loop-func
|
// https://mochajs.org/#dynamically-generating-tests
|
||||||
it(`Should return the ${debuff} on ${key} buff`, () => {
|
// That's why we have eslint-disable here
|
||||||
user.stats.buffs[key] = true;
|
// eslint-disable-next-line no-loop-func
|
||||||
|
it(`Should return the ${debuff} on ${key} buff`, () => {
|
||||||
|
user.stats.buffs[key] = true;
|
||||||
|
|
||||||
let result = getDebuffPotionItems(user);
|
const result = getDebuffPotionItems(user);
|
||||||
|
|
||||||
expect(result).to.be.an('array').that.deep.includes({path: `spells.special.${debuff}`, type: 'debuffPotion'});
|
expect(result).to.be.an('array').that.deep
|
||||||
});
|
.includes({ path: `spells.special.${debuff}`, type: 'debuffPotion' });
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
it('Should return all debuff potions for all buffs', () => {
|
it('Should return all debuff potions for all buffs', () => {
|
||||||
@@ -35,13 +39,13 @@ describe('getDebuffPotionItems', () => {
|
|||||||
user.stats.buffs.shinySeed = true;
|
user.stats.buffs.shinySeed = true;
|
||||||
|
|
||||||
|
|
||||||
let result = getDebuffPotionItems(user);
|
const result = getDebuffPotionItems(user);
|
||||||
|
|
||||||
expect(result).to.be.an('array').that.deep.include.members([
|
expect(result).to.be.an('array').that.deep.include.members([
|
||||||
{path: 'spells.special.sand', type: 'debuffPotion'},
|
{ path: 'spells.special.sand', type: 'debuffPotion' },
|
||||||
{path: 'spells.special.petalFreePotion', type: 'debuffPotion'},
|
{ path: 'spells.special.petalFreePotion', type: 'debuffPotion' },
|
||||||
{path: 'spells.special.salt', type: 'debuffPotion'},
|
{ path: 'spells.special.salt', type: 'debuffPotion' },
|
||||||
{path: 'spells.special.opaquePotion', type: 'debuffPotion'},
|
{ path: 'spells.special.opaquePotion', type: 'debuffPotion' },
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user