Skip to content

Commit

Permalink
make test deterministic
Browse files Browse the repository at this point in the history
  • Loading branch information
morris committed Feb 11, 2024
1 parent 706dcff commit 940f2d3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/Consumer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,11 @@ describe('A Consumer', () => {

await util.waitUntilAcknowledged({ _id: messages[5]._id }, group);

expect(consumed).toMatchObject([
expect(
consumed.sort((a, b) =>
a.value < b.value ? -1 : a.value > b.value ? 1 : 0,
),
).toMatchObject([
{ value: 'should be consumed 1' },
{ value: 'should be consumed 2' },
{ value: 'should be consumed 3' },
Expand Down

0 comments on commit 940f2d3

Please sign in to comment.