Skip to content

Commit

Permalink
ensure test finishes (handle err instead of just timing out)
Browse files Browse the repository at this point in the history
  • Loading branch information
kajoseph committed Jun 4, 2024
1 parent 7aa72a0 commit 22bbb04
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/bitcore-node/test/integration/ethereum/csp.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -434,12 +434,14 @@ const streamWalletTransactionsTest = async (chain: string, network: string, incl
} as StreamWalletTransactionsParams)

let counter = 0;
await new Promise(r => {
const err = await new Promise(r => {
res
.on('data', () => counter++)
.on('error', r)
.on('end', r);
});

expect(err).to.not.exist;
expect(counter).to.eq(includeInvalidTxs ? txCount * 2 : txCount);
sandbox.restore();
};
Expand Down

0 comments on commit 22bbb04

Please sign in to comment.