11import { expect } from 'chai' ;
22import * as firebase from 'firebase-admin' ;
3+ import { FeaturesList } from '../../src/features' ;
34import fft = require( '../../src/index' ) ;
45
56describe ( '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+ } ) ;
812
13+ it ( 'produces the right snapshot with makeDocumentSnapshot' , async ( ) => {
914 const snapshot = test . firestore . makeDocumentSnapshot (
1015 {
1116 email_address :
'[email protected] ' , @@ -20,8 +25,6 @@ describe('providers/firestore', () => {
2025 } ) ;
2126
2227 it ( 'should allow empty document in makeDocumentSnapshot' , async ( ) => {
23- const test = fft ( ) ;
24-
2528 const snapshot = test . firestore . makeDocumentSnapshot (
2629 { } ,
2730 'collection/doc-id'
@@ -32,8 +35,6 @@ describe('providers/firestore', () => {
3235 } ) ;
3336
3437 it ( 'should allow geopoints with makeDocumentSnapshot' , ( ) => {
35- const test = fft ( ) ;
36-
3738 const hq = new firebase . firestore . GeoPoint ( 47.6703 , 122.1971 ) ;
3839 const snapshot = test . firestore . makeDocumentSnapshot (
3940 { geopoint : hq } ,
@@ -43,9 +44,7 @@ describe('providers/firestore', () => {
4344 expect ( snapshot . data ( ) ) . to . deep . equal ( { geopoint : hq } ) ;
4445 } ) ;
4546
46- it ( 'should allow timestmaps with makeDocumentSnapshot' , ( ) => {
47- const test = fft ( ) ;
48-
47+ it ( 'should allow timestamps with makeDocumentSnapshot' , ( ) => {
4948 const time = new Date ( ) ;
5049 const snapshot = test . firestore . makeDocumentSnapshot (
5150 { time } ,
@@ -57,7 +56,6 @@ describe('providers/firestore', () => {
5756 } ) ;
5857
5958 it ( 'should allow references with makeDocumentSnapshot' , ( ) => {
60- const test = fft ( ) ;
6159 firebase . initializeApp ( {
6260 projectId : 'not-a-project' ,
6361 } ) ;
0 commit comments