From: Chris Duncan Date: Thu, 5 Dec 2024 16:16:14 +0000 (-0800) Subject: Replace node test runner 'skip' options with jest 'skip' function. X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=16124be7aeff12c575b2545c3fab6e32f0a62325;p=libnemo.git Replace node test runner 'skip' options with jest 'skip' function. --- diff --git a/perf/wallet.perf.mjs b/perf/wallet.perf.mjs index 3ce78ef..9eb3aca 100644 --- a/perf/wallet.perf.mjs +++ b/perf/wallet.perf.mjs @@ -10,7 +10,7 @@ import { Bip44Wallet, Blake2bWallet } from '#dist/main.js' console.log('wallet performance test') -test('creating BIP-44 wallets', { skip: true }, async () => { +test.skip('creating BIP-44 wallets', async () => { const wallets = [] for (let i = 0x80; i > 0; i--) { wallets.push(await Bip44Wallet.create(NANO_TEST_VECTORS.PASSWORD)) @@ -18,7 +18,7 @@ test('creating BIP-44 wallets', { skip: true }, async () => { assert.equal(wallets.length, 0x80) }) -test('creating BLAKE2b wallets', { skip: true }, async () => { +test.skip('creating BLAKE2b wallets', async () => { const wallets = [] for (let i = 0x80; i > 0; i--) { wallets.push(await Blake2bWallet.create(NANO_TEST_VECTORS.PASSWORD)) diff --git a/test/create-wallet.test.js b/test/create-wallet.test.js index c2e590f..4089db5 100644 --- a/test/create-wallet.test.js +++ b/test/create-wallet.test.js @@ -57,7 +57,7 @@ describe('creating a new wallet', async () => { await assert.rejects(Blake2bWallet.create()) }) - test('connect to ledger', { skip: true }, async () => { + test.skip('connect to ledger', async () => { const wallet = await LedgerWallet.create() assert.ok(wallet) }) diff --git a/test/derive-accounts.test.js b/test/derive-accounts.test.js index 67a6171..9dc9513 100644 --- a/test/derive-accounts.test.js +++ b/test/derive-accounts.test.js @@ -73,7 +73,7 @@ describe('derive child accounts from the same seed', async () => { }) }) -describe('Ledger device accounts', { skip: true }, async () => { +describe.skip('Ledger device accounts', async () => { const wallet = await LedgerWallet.create() test('should fetch the first account from a Ledger device', async () => { diff --git a/test/refresh-accounts.test.js b/test/refresh-accounts.test.js index 0bec0eb..23010d9 100644 --- a/test/refresh-accounts.test.js +++ b/test/refresh-accounts.test.js @@ -12,9 +12,7 @@ const wallet = await Bip44Wallet.fromSeed(NANO_TEST_VECTORS.PASSWORD, NANO_TEST_ await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) const node = new Rpc(process.env.NODE_URL ?? '', process.env.API_KEY_NAME) -const skip = true - -describe('refreshing account info', { skip }, async () => { +describe.skip('refreshing account info', async () => { test('should fetch balance, frontier, and representative', async () => { const accounts = await wallet.accounts() const account = accounts[0] @@ -62,7 +60,7 @@ describe('refreshing account info', { skip }, async () => { }) }) -describe('finding next unopened account', { skip }, async () => { +describe.skip('finding next unopened account', async () => { test('should return correct account from test vector', async () => { const account = await wallet.getNextNewAccount(node) assert.ok(account) @@ -110,7 +108,7 @@ describe('finding next unopened account', { skip }, async () => { }) }) -describe('refreshing wallet accounts', { skip }, async () => { +describe.skip('refreshing wallet accounts', async () => { test('should get balance, frontier, and representative for one account', async () => { const accounts = await wallet.refresh(node) const account = accounts[0] diff --git a/test/tools.test.js b/test/tools.test.js index 1997210..165c9ed 100644 --- a/test/tools.test.js +++ b/test/tools.test.js @@ -8,8 +8,6 @@ import { describe, expect, test } from '@jest/globals' import { RAW_MAX, NANO_TEST_VECTORS } from '#test/TEST_VECTORS.js' import { Bip44Wallet, Account, SendBlock, Rpc, Tools } from '#dist/main.js' -const skip = true - const wallet = await Bip44Wallet.fromSeed(NANO_TEST_VECTORS.PASSWORD, NANO_TEST_VECTORS.BIP39_SEED) await wallet.unlock(NANO_TEST_VECTORS.PASSWORD) const rpc = new Rpc(process.env.NODE_URL ?? '', process.env.API_KEY_NAME) @@ -140,7 +138,7 @@ describe('sweeper', async () => { { message: 'Missing required sweep arguments' }) }) - test('fails gracefully for ineligible accounts', { skip }, async () => { + test.skip('fails gracefully for ineligible accounts', async () => { const results = await Tools.sweep(rpc, wallet, NANO_TEST_VECTORS.ADDRESS_1) assert.ok(results) assert.equal(results.length, 1)