Skip to content

Commit 45852bc

Browse files
authored
test(directory): Update new SharedDirectory.forEach() test (#25303)
## Description Follow up from #25299. Updates the newly added test to ensure `forEach()` iterated the correct number of times and uses `assert.equal` instead of `assert.strictEqual`.
1 parent a0f2f5d commit 45852bc

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

packages/dds/map/src/test/mocha/directory.spec.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,18 +1064,21 @@ describe("Directory", () => {
10641064
// eslint-disable-next-line unicorn/no-array-for-each
10651065
directory1.forEach((value, key) => {
10661066
assert(i < values.length, "forEach() should not have iterated more than i times");
1067-
assert.strictEqual(key, values[i][0], "key should match");
1068-
assert.strictEqual(value, values[i][1], "value should match");
1067+
assert.equal(key, values[i][0], "key should match");
1068+
assert.equal(value, values[i][1], "value should match");
10691069
i++;
10701070
});
1071+
assert.equal(i, values.length, "forEach() should have iterated i times");
1072+
10711073
i = 0;
10721074
// eslint-disable-next-line unicorn/no-array-for-each
10731075
directory2.forEach((value, key) => {
10741076
assert(i < values.length, "forEach() should not have iterated more than i times");
1075-
assert.strictEqual(key, values[i][0], "key should match");
1076-
assert.strictEqual(value, values[i][1], "value should match");
1077+
assert.equal(key, values[i][0], "key should match");
1078+
assert.equal(value, values[i][1], "value should match");
10771079
i++;
10781080
});
1081+
assert.equal(i, values.length, "forEach() should have iterated i times");
10791082
});
10801083

10811084
it("Shouldn't clear value if there is pending set", () => {

0 commit comments

Comments
 (0)