1
1
import { expect } from 'chai' ;
2
2
import * as firebase from 'firebase-admin' ;
3
+ import { FeaturesList } from '../../src/features' ;
3
4
import fft = require( '../../src/index' ) ;
4
5
5
6
describe ( 'providers/firestore' , ( ) => {
6
- it ( 'produces the right snapshot with makeDocumentSnapshot' , async ( ) => {
7
- const test = fft ( ) ;
7
+ let test : FeaturesList ;
8
+
9
+ beforeEach ( ( ) => {
10
+ test = fft ( ) ;
11
+ } ) ;
8
12
13
+ it ( 'produces the right snapshot with makeDocumentSnapshot' , async ( ) => {
9
14
const snapshot = test . firestore . makeDocumentSnapshot (
10
15
{
11
16
email_address :
'[email protected] ' ,
@@ -20,8 +25,6 @@ describe('providers/firestore', () => {
20
25
} ) ;
21
26
22
27
it ( 'should allow empty document in makeDocumentSnapshot' , async ( ) => {
23
- const test = fft ( ) ;
24
-
25
28
const snapshot = test . firestore . makeDocumentSnapshot (
26
29
{ } ,
27
30
'collection/doc-id'
@@ -32,8 +35,6 @@ describe('providers/firestore', () => {
32
35
} ) ;
33
36
34
37
it ( 'should allow geopoints with makeDocumentSnapshot' , ( ) => {
35
- const test = fft ( ) ;
36
-
37
38
const hq = new firebase . firestore . GeoPoint ( 47.6703 , 122.1971 ) ;
38
39
const snapshot = test . firestore . makeDocumentSnapshot (
39
40
{ geopoint : hq } ,
@@ -43,9 +44,7 @@ describe('providers/firestore', () => {
43
44
expect ( snapshot . data ( ) ) . to . deep . equal ( { geopoint : hq } ) ;
44
45
} ) ;
45
46
46
- it ( 'should allow timestmaps with makeDocumentSnapshot' , ( ) => {
47
- const test = fft ( ) ;
48
-
47
+ it ( 'should allow timestamps with makeDocumentSnapshot' , ( ) => {
49
48
const time = new Date ( ) ;
50
49
const snapshot = test . firestore . makeDocumentSnapshot (
51
50
{ time } ,
@@ -57,7 +56,6 @@ describe('providers/firestore', () => {
57
56
} ) ;
58
57
59
58
it ( 'should allow references with makeDocumentSnapshot' , ( ) => {
60
- const test = fft ( ) ;
61
59
firebase . initializeApp ( {
62
60
projectId : 'not-a-project' ,
63
61
} ) ;
0 commit comments