From a2c2329981ead536caa2f429e181cb8af8bc289d Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Sat, 12 Oct 2024 20:33:50 -0700 Subject: [PATCH] Fix reference to account balance type in test. --- test/refresh-accounts.test.mjs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/refresh-accounts.test.mjs b/test/refresh-accounts.test.mjs index c1427d3..19477d7 100644 --- a/test/refresh-accounts.test.mjs +++ b/test/refresh-accounts.test.mjs @@ -15,7 +15,7 @@ const wallet = await Bip44Wallet.fromSeed(NANO_TEST_VECTORS.PASSWORD, NANO_TEST_ await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) const node = new Node(process.env.NODE_URL, process.env.API_KEY_NAME, process.env.API_KEY_VALUE) -const skip = true +const skip = false describe('refreshing account info', { skip }, async () => { it('should fetch balance, frontier, and representative', async () => { @@ -23,12 +23,11 @@ describe('refreshing account info', { skip }, async () => { const account = accounts[0] await account.refresh(node) - assert.equal(typeof account.balance, 'string') + assert.equal(typeof account.balance, 'bigint') assert.notEqual(account.balance, undefined) assert.notEqual(account.balance, null) assert.notEqual(account.balance, '') - assert.equal(isNaN(parseInt(account.balance)), false) - assert.equal(parseInt(account.balance) < 0, false) + assert.notEqual(account.balance < 0, true) assert.equal(typeof account.frontier, 'string') assert.notEqual(account.frontier, undefined) @@ -108,11 +107,12 @@ describe('finding next unopened account', { skip }, async () => { describe('refreshing wallet accounts', { skip }, async () => { it('should get balance, frontier, and representative for one account', async () => { const accounts = await wallet.refresh(node) - assert.ok(accounts[0] instanceof Account) - assert.equal(typeof accounts[0].balance, 'bigint') - assert.notEqual(accounts[0].frontier, undefined) - assert.notEqual(accounts[0].frontier, null) - assert.equal(typeof accounts[0].frontier, 'string') + const account = accounts[0] + assert.ok(account instanceof Account) + assert.equal(typeof account.balance, 'bigint') + assert.notEqual(account.frontier, undefined) + assert.notEqual(account.frontier, null) + assert.equal(typeof account.frontier, 'string') }) it('should get balance, frontier, and representative for multiple accounts', async () => { -- 2.34.1