Skip to content

Commit

Permalink
fixup! fixup! test(cardano-services): waits all the chunks before sea…
Browse files Browse the repository at this point in the history
…rching for substrings
  • Loading branch information
iccicci committed Mar 17, 2023
1 parent 726b8f1 commit 398f4be
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/cardano-services/test/cli.test.ts
Expand Up @@ -131,11 +131,12 @@ const callCliAndAssertExit = (
chunks.push(data.toString());
});
proc.on('exit', (code) => {
if (dataMatchOnError) expect(chunks.join('')).toContain(dataMatchOnError);
expect(code).toBe(1);
expect(spy).toHaveBeenCalled();
done();
if (dataMatchOnError) expect(chunks.join('')).toContain(dataMatchOnError);
});
// Wait for the assertions from the previous exit handler before calling the done callback
proc.on('exit', () => setTimeout(done, 10));
};

describe('CLI', () => {
Expand Down

0 comments on commit 398f4be

Please sign in to comment.