Skip to content

Commit 03ad8e5

Browse files
committed
Fix null/undefined handling in object key length assertion
1 parent a55141c commit 03ad8e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/Utils/AssertExtensions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export class JavaAssertionBuilder {
9494
if (this._value instanceof Map) {
9595
assert.strictEqual(this._value.size, n);
9696
} else {
97-
assert.strictEqual(Object.keys(this._value).length, n);
97+
assert.strictEqual(Object.keys(this._value ?? {}).length, n);
9898
}
9999

100100
return this;

0 commit comments

Comments
 (0)