Skip to content

Commit 332c36c

Browse files
Add tests to ensure that FieldValue has no cyclic references (#3869)
1 parent 53ccf19 commit 332c36c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/firestore/test/unit/api/field_value.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,12 @@ describe('FieldValue', () => {
3333
expect(FieldValue.arrayUnion('a')).to.be.an.instanceOf(FieldValue);
3434
expect(FieldValue.arrayRemove('a')).to.be.an.instanceOf(FieldValue);
3535
});
36+
37+
it('JSON.stringify() does not throw', () => {
38+
JSON.stringify(FieldValue.delete());
39+
JSON.stringify(FieldValue.serverTimestamp());
40+
JSON.stringify(FieldValue.increment(1));
41+
JSON.stringify(FieldValue.arrayUnion(2));
42+
JSON.stringify(FieldValue.arrayRemove(3));
43+
});
3644
});

0 commit comments

Comments
 (0)