Skip to content

Commit

Permalink
began tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Egge21M committed Jun 25, 2024
1 parent 2458c79 commit ee5f4a4
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions test/WSConnection.test.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
import { WSConnection, injectWebSocketImpl } from '../src/WSConnection';
import { CashuMint, CashuWallet } from '../src/index';

describe('testing WSConnection', () => {
test('connecting...', async () => {
injectWebSocketImpl(require('ws'));
const ws = new WSConnection('https://echo.websocket.org/');
await ws.connect();
const sub = ws.subscribe('check_proof');
await new Promise((res) => {
// @ts-ignore
sub.onmessage((e) => {
console.log(e);
res(e);
});
});
const wallet = new CashuWallet(new CashuMint('ws://localhost:3338'));
const quote = await wallet.getMintQuote(21);
console.log(quote);
});
});

0 comments on commit ee5f4a4

Please sign in to comment.