From: Chris Duncan Date: Sun, 13 Oct 2024 03:33:50 +0000 (-0700) Subject: Fix reference to account balance type in test. X-Git-Tag: v0.0.8~2 X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=a2c2329981ead536caa2f429e181cb8af8bc289d;p=libnemo.git Fix reference to account balance type in test. --- 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 () => {