@@ -32,6 +32,10 @@ describe('CollectionReference', () => {
32
32
expectEqual ( collectionReference ( 'foo' ) , collectionReference ( 'foo' ) ) ;
33
33
expectNotEqual ( collectionReference ( 'foo' ) , collectionReference ( 'bar' ) ) ;
34
34
} ) ;
35
+
36
+ it ( 'JSON.stringify() does not throw' , ( ) => {
37
+ JSON . stringify ( collectionReference ( 'foo' ) ) ;
38
+ } ) ;
35
39
} ) ;
36
40
37
41
describe ( 'DocumentReference' , ( ) => {
@@ -42,6 +46,10 @@ describe('DocumentReference', () => {
42
46
documentReference ( 'rooms/bar' )
43
47
) ;
44
48
} ) ;
49
+
50
+ it ( 'JSON.stringify() does not throw' , ( ) => {
51
+ JSON . stringify ( documentReference ( 'foo/bar' ) ) ;
52
+ } ) ;
45
53
} ) ;
46
54
47
55
describe ( 'DocumentSnapshot' , ( ) => {
@@ -72,13 +80,21 @@ describe('DocumentSnapshot', () => {
72
80
documentSnapshot ( 'rooms/bar' , { a : 1 } , false )
73
81
) ;
74
82
} ) ;
83
+
84
+ it ( 'JSON.stringify() does not throw' , ( ) => {
85
+ JSON . stringify ( documentSnapshot ( 'foo/bar' , { a : 1 } , true ) ) ;
86
+ } ) ;
75
87
} ) ;
76
88
77
89
describe ( 'Query' , ( ) => {
78
90
it ( 'support equality checking with isEqual()' , ( ) => {
79
91
expectEqual ( query ( 'foo' ) , query ( 'foo' ) ) ;
80
92
expectNotEqual ( query ( 'foo' ) , query ( 'bar' ) ) ;
81
93
} ) ;
94
+
95
+ it ( 'JSON.stringify() does not throw' , ( ) => {
96
+ JSON . stringify ( query ( 'foo' ) ) ;
97
+ } ) ;
82
98
} ) ;
83
99
84
100
describe ( 'QuerySnapshot' , ( ) => {
@@ -123,6 +139,12 @@ describe('QuerySnapshot', () => {
123
139
querySnapshot ( 'foo' , { } , { a : { a : 1 } } , keys ( 'foo/a' ) , false , true )
124
140
) ;
125
141
} ) ;
142
+
143
+ it ( 'JSON.stringify() does not throw' , ( ) => {
144
+ JSON . stringify (
145
+ querySnapshot ( 'foo' , { } , { a : { a : 1 } } , keys ( ) , false , false )
146
+ ) ;
147
+ } ) ;
126
148
} ) ;
127
149
128
150
describe ( 'SnapshotMetadata' , ( ) => {
0 commit comments