const wallet = await Bip44Wallet.create(NANO_TEST_VECTORS.PASSWORD)\r
await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
\r
- assert.ok('id' in wallet)\r
- assert.ok(/[A-Fa-f0-9]{32,64}/.test(wallet.id))\r
- assert.ok('mnemonic' in wallet)\r
- assert.ok(/^(?:[a-z]{3,} ){11,23}[a-z]{3,}$/.test(wallet.mnemonic))\r
- assert.ok('seed' in wallet)\r
- assert.ok(/[A-Fa-f0-9]{32,64}/.test(wallet.seed))\r
+ expect('id' in wallet).toBeTruthy()\r
+ expect(/[A-Fa-f0-9]{32,64}/.test(wallet.id)).toBeTruthy()\r
+ expect('mnemonic' in wallet).toBeTruthy()\r
+ expect(/^(?:[a-z]{3,} ){11,23}[a-z]{3,}$/.test(wallet.mnemonic)).toBeTruthy()\r
+ expect('seed' in wallet).toBeTruthy()\r
+ expect(/[A-Fa-f0-9]{32,64}/.test(wallet.seed)).toBeTruthy()\r
})\r
\r
test('BLAKE2b wallet with random entropy', async () => {\r
const wallet = await Blake2bWallet.create(NANO_TEST_VECTORS.PASSWORD)\r
await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)\r
\r
- assert.ok('id' in wallet)\r
- assert.ok(/[A-Fa-f0-9]{32,64}/.test(wallet.id))\r
- assert.ok('mnemonic' in wallet)\r
- assert.ok(/^(?:[a-z]{3,} ){11,23}[a-z]{3,}$/.test(wallet.mnemonic))\r
- assert.ok('seed' in wallet)\r
- assert.ok(/[A-Fa-f0-9]{32,64}/.test(wallet.seed))\r
+ expect('id' in wallet).toBeTruthy()\r
+ expect(/[A-Fa-f0-9]{32,64}/.test(wallet.id)).toBeTruthy()\r
+ expect('mnemonic' in wallet).toBeTruthy()\r
+ expect(/^(?:[a-z]{3,} ){11,23}[a-z]{3,}$/.test(wallet.mnemonic)).toBeTruthy()\r
+ expect('seed' in wallet).toBeTruthy()\r
+ expect(/[A-Fa-f0-9]{32,64}/.test(wallet.seed)).toBeTruthy()\r
})\r
\r
test('BIP-44 replace invalid salt with empty string', async () => {\r
\r
test('fail when using new', async () => {\r
//@ts-expect-error\r
- assert.throws(() => new Bip44Wallet())\r
+ expect(() => new Bip44Wallet()).toThrow()\r
//@ts-expect-error\r
- assert.throws(() => new Blake2bWallet())\r
+ expect(() => new Blake2bWallet()).toThrow()\r
//@ts-expect-error\r
- assert.throws(() => new LedgerWallet())\r
+ expect(() => new LedgerWallet()).toThrow()\r
})\r
\r
test('fail without a password', async () => {\r
//@ts-expect-error\r
- await assert.rejects(Bip44Wallet.create())\r
+ expect(async () => await Bip44Wallet.create()).rejects()\r
//@ts-expect-error\r
- await assert.rejects(Blake2bWallet.create())\r
+ expect(async () => await Blake2bWallet.create()).rejects()\r
})\r
\r
test.skip('connect to ledger', async () => {\r
const wallet = await LedgerWallet.create()\r
- assert.ok(wallet)\r
+ expect(wallet).toBeDefined()\r
})\r
})\r