@@ -27,15 +27,15 @@ void runDocumentReferenceTests() {
27
27
group (
28
28
'DocumentReference.snapshots()' ,
29
29
() {
30
- testWidgets ('returns a [Stream]' , (_ ) async {
30
+ test ('returns a [Stream]' , () async {
31
31
DocumentReference <Map <String , dynamic >> document =
32
32
await initializeTest ('document-snapshot' );
33
33
Stream <DocumentSnapshot <Map <String , dynamic >>> stream =
34
34
document.snapshots ();
35
35
expect (stream, isA <Stream <DocumentSnapshot <Map <String , dynamic >>>>());
36
36
});
37
37
38
- testWidgets ('can be reused' , (_ ) async {
38
+ test ('can be reused' , () async {
39
39
final foo = await initializeTest ('foo' );
40
40
41
41
final snapshot = foo.snapshots ();
@@ -66,7 +66,7 @@ void runDocumentReferenceTests() {
66
66
);
67
67
});
68
68
69
- testWidgets ('listens to a single response' , (_ ) async {
69
+ test ('listens to a single response' , () async {
70
70
DocumentReference <Map <String , dynamic >> document =
71
71
await initializeTest ('document-snapshot' );
72
72
Stream <DocumentSnapshot <Map <String , dynamic >>> stream =
@@ -88,7 +88,7 @@ void runDocumentReferenceTests() {
88
88
});
89
89
});
90
90
91
- testWidgets ('listens to a single response from cache' , (_ ) async {
91
+ test ('listens to a single response from cache' , () async {
92
92
DocumentReference <Map <String , dynamic >> document =
93
93
await initializeTest ('document-snapshot' );
94
94
Stream <DocumentSnapshot <Map <String , dynamic >>> stream =
@@ -110,7 +110,7 @@ void runDocumentReferenceTests() {
110
110
});
111
111
});
112
112
113
- testWidgets ('listens to a document from cache' , (_ ) async {
113
+ test ('listens to a document from cache' , () async {
114
114
DocumentReference <Map <String , dynamic >> document =
115
115
await initializeTest ('document-snapshot-cache' );
116
116
await document.set ({'foo' : 'bar' });
@@ -134,7 +134,7 @@ void runDocumentReferenceTests() {
134
134
});
135
135
});
136
136
137
- testWidgets ('listens to multiple documents' , (_ ) async {
137
+ test ('listens to multiple documents' , () async {
138
138
DocumentReference <Map <String , dynamic >> doc1 =
139
139
await initializeTest ('document-snapshot-1' );
140
140
DocumentReference <Map <String , dynamic >> doc2 =
@@ -150,7 +150,7 @@ void runDocumentReferenceTests() {
150
150
await expectLater (value2, completion ('value2' ));
151
151
});
152
152
153
- testWidgets ('listens to a multiple changes response' , (_ ) async {
153
+ test ('listens to a multiple changes response' , () async {
154
154
DocumentReference <Map <String , dynamic >> document =
155
155
await initializeTest ('document-snapshot-multiple' );
156
156
Stream <DocumentSnapshot <Map <String , dynamic >>> stream =
@@ -197,7 +197,7 @@ void runDocumentReferenceTests() {
197
197
);
198
198
});
199
199
200
- testWidgets ('listeners throws a [FirebaseException]' , (_ ) async {
200
+ test ('listeners throws a [FirebaseException]' , () async {
201
201
DocumentReference <Map <String , dynamic >> document =
202
202
firestore.doc ('not-allowed/document' );
203
203
Stream <DocumentSnapshot <Map <String , dynamic >>> stream =
@@ -220,7 +220,7 @@ void runDocumentReferenceTests() {
220
220
);
221
221
222
222
group ('DocumentReference.delete()' , () {
223
- testWidgets ('delete() deletes a document' , (_ ) async {
223
+ test ('delete() deletes a document' , () async {
224
224
DocumentReference <Map <String , dynamic >> document =
225
225
await initializeTest ('document-delete' );
226
226
await document.set ({
@@ -233,9 +233,9 @@ void runDocumentReferenceTests() {
233
233
expect (snapshot2.exists, isFalse);
234
234
});
235
235
236
- testWidgets (
236
+ test (
237
237
'throws a [FirebaseException] on error' ,
238
- (_ ) async {
238
+ () async {
239
239
DocumentReference <Map <String , dynamic >> document =
240
240
firestore.doc ('not-allowed/document' );
241
241
@@ -257,7 +257,7 @@ void runDocumentReferenceTests() {
257
257
});
258
258
259
259
group ('DocumentReference.get()' , () {
260
- testWidgets ('gets a document from server' , (_ ) async {
260
+ test ('gets a document from server' , () async {
261
261
DocumentReference <Map <String , dynamic >> document =
262
262
await initializeTest ('document-get-server' );
263
263
await document.set ({'foo' : 'bar' });
@@ -267,9 +267,9 @@ void runDocumentReferenceTests() {
267
267
expect (snapshot.metadata.isFromCache, isFalse);
268
268
});
269
269
270
- testWidgets (
270
+ test (
271
271
'gets a document from cache' ,
272
- (_ ) async {
272
+ () async {
273
273
DocumentReference <Map <String , dynamic >> document =
274
274
await initializeTest ('document-get-cache' );
275
275
await document.set ({'foo' : 'bar' });
@@ -281,9 +281,9 @@ void runDocumentReferenceTests() {
281
281
skip: kIsWeb,
282
282
);
283
283
284
- testWidgets (
284
+ test (
285
285
'throws a [FirebaseException] on error' ,
286
- (_ ) async {
286
+ () async {
287
287
DocumentReference <Map <String , dynamic >> document =
288
288
firestore.doc ('not-allowed/document' );
289
289
@@ -303,7 +303,7 @@ void runDocumentReferenceTests() {
303
303
});
304
304
305
305
group ('DocumentReference.set()' , () {
306
- testWidgets ('sets data' , (_ ) async {
306
+ test ('sets data' , () async {
307
307
DocumentReference <Map <String , dynamic >> document =
308
308
await initializeTest ('document-set' );
309
309
await document.set ({'foo' : 'bar' });
@@ -314,7 +314,7 @@ void runDocumentReferenceTests() {
314
314
expect (snapshot2.data (), equals ({'bar' : 'baz' }));
315
315
});
316
316
317
- testWidgets ('set() merges data' , (_ ) async {
317
+ test ('set() merges data' , () async {
318
318
DocumentReference <Map <String , dynamic >> document =
319
319
await initializeTest ('document-set-merge' );
320
320
await document.set ({'foo' : 'bar' });
@@ -326,9 +326,9 @@ void runDocumentReferenceTests() {
326
326
expect (snapshot2.data (), equals ({'foo' : 'ben' , 'bar' : 'baz' }));
327
327
});
328
328
329
- testWidgets (
329
+ test (
330
330
'set() merges fields' ,
331
- (_ ) async {
331
+ () async {
332
332
DocumentReference <Map <String , dynamic >> document =
333
333
await initializeTest ('document-set-merge-fields' );
334
334
Map <String , dynamic > initialData = {
@@ -363,9 +363,9 @@ void runDocumentReferenceTests() {
363
363
},
364
364
);
365
365
366
- testWidgets (
366
+ test (
367
367
'throws a [FirebaseException] on error' ,
368
- (_ ) async {
368
+ () async {
369
369
DocumentReference <Map <String , dynamic >> document =
370
370
firestore.doc ('not-allowed/document' );
371
371
@@ -383,7 +383,7 @@ void runDocumentReferenceTests() {
383
383
},
384
384
);
385
385
386
- testWidgets ('set and return all possible datatypes' , (_ ) async {
386
+ test ('set and return all possible datatypes' , () async {
387
387
DocumentReference <Map <String , dynamic >> document =
388
388
await initializeTest ('document-types' );
389
389
@@ -453,7 +453,7 @@ void runDocumentReferenceTests() {
453
453
});
454
454
455
455
group ('DocumentReference.update()' , () {
456
- testWidgets ('updates data' , (_ ) async {
456
+ test ('updates data' , () async {
457
457
DocumentReference <Map <String , dynamic >> document =
458
458
await initializeTest ('document-update' );
459
459
await document.set ({'foo' : 'bar' });
@@ -464,7 +464,7 @@ void runDocumentReferenceTests() {
464
464
expect (snapshot2.data (), equals ({'foo' : 'bar' , 'bar' : 'baz' }));
465
465
});
466
466
467
- testWidgets ('updates nested data using dots' , (_ ) async {
467
+ test ('updates nested data using dots' , () async {
468
468
DocumentReference <Map <String , dynamic >> document =
469
469
await initializeTest ('document-update-field-path' );
470
470
await document.set ({
@@ -488,7 +488,7 @@ void runDocumentReferenceTests() {
488
488
);
489
489
});
490
490
491
- testWidgets ('updates nested data using FieldPath' , (_ ) async {
491
+ test ('updates nested data using FieldPath' , () async {
492
492
DocumentReference <Map <String , dynamic >> document =
493
493
await initializeTest ('document-update-field-path' );
494
494
await document.set ({
@@ -514,8 +514,7 @@ void runDocumentReferenceTests() {
514
514
);
515
515
});
516
516
517
- testWidgets ('updates nested data containing a dot using FieldPath' ,
518
- (_) async {
517
+ test ('updates nested data containing a dot using FieldPath' , () async {
519
518
DocumentReference <Map <String , dynamic >> document =
520
519
await initializeTest ('document-update-field-path' );
521
520
await document.set ({'foo.bar' : 'baz' });
@@ -535,9 +534,9 @@ void runDocumentReferenceTests() {
535
534
);
536
535
});
537
536
538
- testWidgets (
537
+ test (
539
538
'throws if document does not exist' ,
540
- (_ ) async {
539
+ () async {
541
540
DocumentReference <Map <String , dynamic >> document =
542
541
await initializeTest ('document-update-not-exists' );
543
542
try {
@@ -555,9 +554,9 @@ void runDocumentReferenceTests() {
555
554
});
556
555
557
556
group ('withConverter' , () {
558
- testWidgets (
557
+ test (
559
558
'set/snapshot/get' ,
560
- (_ ) async {
559
+ () async {
561
560
final foo = await initializeTest ('foo' );
562
561
final fooConverter = foo.withConverter <int >(
563
562
fromFirestore: (snapshots, _) => snapshots.data ()! ['value' ]! as int ,
0 commit comments