From 32d33db4229efd58e7d688a516f32ada963ddeef Mon Sep 17 00:00:00 2001 From: Tobiah Date: Wed, 15 Feb 2023 20:33:08 -0600 Subject: [PATCH] fix: check the right objects for archwing --- src/ArsenalParser.js | 4 ++-- test/regression/module.spec.js | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ArsenalParser.js b/src/ArsenalParser.js index 4d8d820..e0e4a09 100644 --- a/src/ArsenalParser.js +++ b/src/ArsenalParser.js @@ -39,8 +39,8 @@ module.exports = class ArsenalData { this.loadout.archwing = {}; if (archwing && !archwing.hide) this.loadout.archwing.archwing = new Archwing(archwing); - if (archPrimary && !archPrimary.hide) this.loadout.archwing.primary = new Weapon(primary); - if (archMelee && !archMelee.hide) this.loadout.archwing.melee = new Weapon(melee); + if (archPrimary && !archPrimary.hide) this.loadout.archwing.primary = new Weapon(archPrimary); + if (archMelee && !archMelee.hide) this.loadout.archwing.melee = new Weapon(archMelee); if (parazon && !parazon.hide) this.loadout.parazon = new Parazon(parazon); diff --git a/test/regression/module.spec.js b/test/regression/module.spec.js index 24cd3a5..4a7affa 100644 --- a/test/regression/module.spec.js +++ b/test/regression/module.spec.js @@ -18,7 +18,9 @@ describe('ArsenalData', function () { describe('#constructor', () => { it('can parse live data', async function () { if (!(await working())) this.skip(); - assert.isOk(new ArsenalData(await fetch('tobiah'))); + const parsed = JSON.parse(JSON.stringify(new ArsenalData(await fetch('tobiah')))); + assert.equal(parsed.account.name, 'Tobiah'); + assert.isOk(parsed); }); }); });