Skip to content

Commit

Permalink
Fixes flakey test (#359)
Browse files Browse the repository at this point in the history
Test used first element in test array as heuristic to determine a list was not equal. This lead to test flake and was never really that useful.
  • Loading branch information
tywalch authored Feb 25, 2024
1 parent 1e1ae35 commit c6d2332
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/ts_connected.crud.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4141,8 +4141,15 @@ describe("pagination order", () => {
.get(batch)
.go()
.then((res) => [res.data, res.unprocessed] as const);

expect(batch[0]).to.not.deep.equal(unOrderedRecords[0]);
const notExactlyEqual = batch.some((item, i) => {
try {
expect(item).not.to.deep.equal(unOrderedRecords[i]);
return true;
} catch(err) {
return false;
}
});
expect(notExactlyEqual).to.be.true;
expect(unOrderedRecords)
.to.be.an("array")
.with.length(batch.length - totalUnprocessed);
Expand Down

0 comments on commit c6d2332

Please sign in to comment.