Skip to content

Commit

Permalink
fix resulting tests and more
Browse files Browse the repository at this point in the history
  • Loading branch information
KraXen72 committed Jul 18, 2024
1 parent 3a6bf05 commit 096b82f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/legacy/nut-06.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ export function handleMintInfoContactFieldDeprecated(data: GetInfoResponse) {
});
}
return data;
}
}
8 changes: 5 additions & 3 deletions test/wallet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,16 @@ describe('receive', () => {
nock(mintUrl).post('/v1/swap').reply(400, { detail: msg });
const wallet = new CashuWallet(mint, { unit });
const result = await wallet.receive(tokenInput).catch((e) => e);
expect(result).toEqual(new Error('Error when receiving'));
expect(result).toBeInstanceOf(Error);
expect(result.message.startsWith('Error when receiving')).toBe(true);
});

test('test receive could not verify proofs', async () => {
nock(mintUrl).post('/v1/swap').reply(400, { code: 0, error: 'could not verify proofs.' });
const wallet = new CashuWallet(mint, { unit });
const result = await wallet.receive(tokenInput).catch((e) => e);
expect(result).toEqual(new Error('Error when receiving'));
expect(result).toBeInstanceOf(Error);
expect(result.message.startsWith('Error when receiving')).toBe(true);
});
});

Expand All @@ -208,7 +210,7 @@ describe('checkProofsSpent', () => {

const result = await wallet.checkProofsSpent(proofs);

expect(result).toStrictEqual([]);
expect(result).toEqual({ spent: [], pending: [] });
});
});

Expand Down

0 comments on commit 096b82f

Please sign in to comment.