From 0731dcd453c0df108fae6d00dc151f429dc27492 Mon Sep 17 00:00:00 2001 From: Xaz16 Date: Sun, 17 Nov 2019 23:57:42 +0300 Subject: [PATCH] Fix: lint --- test/common/libs/getDebuffPotionItems.test.js | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/test/common/libs/getDebuffPotionItems.test.js b/test/common/libs/getDebuffPotionItems.test.js index cc7520db0c..ae151964af 100644 --- a/test/common/libs/getDebuffPotionItems.test.js +++ b/test/common/libs/getDebuffPotionItems.test.js @@ -13,19 +13,23 @@ describe('getDebuffPotionItems', () => { user = generateUser(); }); - for (let key in TRANSFORMATION_DEBUFFS_LIST) { - const debuff = TRANSFORMATION_DEBUFFS_LIST[key]; - // Here we itterate whole object to dynamicaly create test suites as it described in dock of mocha - // https://mochajs.org/#dynamically-generating-tests - // That's why we have eslint-disable here - // eslint-disable-next-line no-loop-func - it(`Should return the ${debuff} on ${key} buff`, () => { - user.stats.buffs[key] = true; + for (const key in TRANSFORMATION_DEBUFFS_LIST) { + if (Object.prototype.hasOwnProperty.call(TRANSFORMATION_DEBUFFS_LIST, key)) { + const debuff = TRANSFORMATION_DEBUFFS_LIST[key]; + // Here we itterate whole object to dynamicaly create test suites as + // it described in dock of mocha + // https://mochajs.org/#dynamically-generating-tests + // That's why we have eslint-disable here + // 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', () => { @@ -35,13 +39,13 @@ describe('getDebuffPotionItems', () => { user.stats.buffs.shinySeed = true; - let result = getDebuffPotionItems(user); + const result = getDebuffPotionItems(user); expect(result).to.be.an('array').that.deep.include.members([ - {path: 'spells.special.sand', type: 'debuffPotion'}, - {path: 'spells.special.petalFreePotion', type: 'debuffPotion'}, - {path: 'spells.special.salt', type: 'debuffPotion'}, - {path: 'spells.special.opaquePotion', type: 'debuffPotion'}, + { path: 'spells.special.sand', type: 'debuffPotion' }, + { path: 'spells.special.petalFreePotion', type: 'debuffPotion' }, + { path: 'spells.special.salt', type: 'debuffPotion' }, + { path: 'spells.special.opaquePotion', type: 'debuffPotion' }, ]); }); });