15
15
* limitations under the License.
16
16
*/
17
17
18
- import { expect } from 'chai' ;
19
- import {
20
- countQuery ,
21
- getAggregateFromServerDirect ,
22
- query
23
- } from '../util/firebase_export' ;
24
- import { apiDescribe , withTestCollection } from '../util/helpers' ;
25
-
26
- apiDescribe ( 'Aggregation COUNT query:' , ( persistence : boolean ) => {
27
- it . only ( 'empty collection count equals to 0' , ( ) => {
28
- const testDocs = { } ;
29
- return withTestCollection ( persistence , testDocs , collection => {
30
- const countQuery_ = countQuery ( query ( collection ) ) ;
31
- return getAggregateFromServerDirect ( countQuery_ ) . then ( snapshot => {
32
- expect ( snapshot . getCount ( ) ) . to . equal ( 0 ) ;
33
- } ) ;
34
- } ) ;
35
- } ) ;
36
-
37
- it . only ( 'test collection count equals to 6' , ( ) => {
38
- const testDocs = {
39
- a : { k : 'a' } ,
40
- b : { k : 'b' } ,
41
- c : { k : 'c' } ,
42
- d : { k : 'd' } ,
43
- e : { k : 'e' } ,
44
- f : { k : 'f' }
45
- } ;
46
- return withTestCollection ( persistence , testDocs , collection => {
47
- const countQuery_ = countQuery ( query ( collection ) ) ;
48
- return getAggregateFromServerDirect ( countQuery_ ) . then ( snapshot => {
49
- expect ( snapshot . getCount ( ) ) . to . equal ( 6 ) ;
50
- } ) ;
51
- } ) ;
52
- } ) ;
53
- } ) ;
18
+ import { expect } from 'chai' ;
19
+ import {
20
+ countQuery ,
21
+ getAggregateFromServerDirect ,
22
+ query
23
+ } from '../util/firebase_export' ;
24
+ import { apiDescribe , withTestCollection } from '../util/helpers' ;
25
+
26
+ apiDescribe ( 'Aggregation COUNT query:' , ( persistence : boolean ) => {
27
+ it . only ( 'empty collection count equals to 0' , ( ) => {
28
+ const testDocs = { } ;
29
+ return withTestCollection ( persistence , testDocs , collection => {
30
+ const countQuery_ = countQuery ( query ( collection ) ) ;
31
+ return getAggregateFromServerDirect ( countQuery_ ) . then ( snapshot => {
32
+ expect ( snapshot . getCount ( ) ) . to . equal ( 0 ) ;
33
+ } ) ;
34
+ } ) ;
35
+ } ) ;
36
+
37
+ it . only ( 'test collection count equals to 6' , ( ) => {
38
+ const testDocs = {
39
+ a : { k : 'a' } ,
40
+ b : { k : 'b' } ,
41
+ c : { k : 'c' } ,
42
+ d : { k : 'd' } ,
43
+ e : { k : 'e' } ,
44
+ f : { k : 'f' }
45
+ } ;
46
+ return withTestCollection ( persistence , testDocs , collection => {
47
+ const countQuery_ = countQuery ( query ( collection ) ) ;
48
+ return getAggregateFromServerDirect ( countQuery_ ) . then ( snapshot => {
49
+ expect ( snapshot . getCount ( ) ) . to . equal ( 6 ) ;
50
+ } ) ;
51
+ } ) ;
52
+ } ) ;
53
+ } ) ;
0 commit comments