Skip to content

Commit ad40074

Browse files
authored
spec_test_runner.ts: sort document changes before comparing for pairwise correctness (#7020)
1 parent 67c5a0d commit ad40074

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/firestore/test/unit/specs/spec_test_runner.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,13 @@ abstract class TestRunner {
11721172
});
11731173
}
11741174

1175-
expect(actual.view!.docChanges).to.deep.equal(expectedChanges);
1175+
const actualChangesSorted = Array.from(actual.view!.docChanges).sort(
1176+
(a, b) => primitiveComparator(a.doc, b.doc)
1177+
);
1178+
const expectedChangesSorted = Array.from(expectedChanges).sort((a, b) =>
1179+
primitiveComparator(a.doc, b.doc)
1180+
);
1181+
expect(actualChangesSorted).to.deep.equal(expectedChangesSorted);
11761182

11771183
expect(actual.view!.hasPendingWrites).to.equal(
11781184
expected.hasPendingWrites,

0 commit comments

Comments
 (0)