UNPKG

@kadena/kadena-cli

Version:

Kadena CLI tool to interact with the Kadena blockchain (manage keys, transactions, etc.)

43 lines 1.63 kB
import path from 'path'; import { beforeEach, describe, expect, it } from 'vitest'; import { WORKING_DIRECTORY } from '../../../constants/config.js'; import { services } from '../../../services/index.js'; import { mockPrompts, runCommandJson } from '../../../utils/test.util.js'; describe('delete wallet', () => { const walletPath = path.join(WORKING_DIRECTORY, '.kadena/wallets/test.yaml'); beforeEach(async () => { const wallet = await services.wallet.create({ alias: 'test', legacy: false, password: '123123123', }); expect(wallet.wallet.filepath).toEqual(walletPath); expect(await services.filesystem.fileExists(walletPath)).toBe(true); }); it('Should delete a specific wallet', async () => { const res = await runCommandJson([ 'wallet', 'delete', '-w', 'test', '-c', '--quiet', ]); expect(res.deleted).toEqual(['test']); expect(await services.filesystem.fileExists(walletPath)).toBe(false); }); it('Should delete a specific wallet with prompts', async () => { mockPrompts({ select: { 'Select a wallet': 'test', }, input: { 'Are you sure you want to delete the wallet:': 'yes', }, }); const res = await runCommandJson(['wallet', 'delete']); expect(res.deleted).toEqual(['test']); expect(await services.filesystem.fileExists(walletPath)).toBe(false); }); }); //# sourceMappingURL=walletDelete.test.js.map