File tree 2 files changed +9
-5
lines changed
2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import * as database from './providers/database';
5
5
import * as firestore from './providers/firestore' ;
6
6
import * as pubsub from './providers/pubsub' ;
7
7
import * as storage from './providers/storage' ;
8
+ import { FirebaseFunctionsTest } from './lifecycle' ;
8
9
9
10
export interface LazyFeatures {
10
11
mockConfig : typeof mockConfig ;
@@ -31,5 +32,5 @@ export const features: LazyFeatures = {
31
32
} ;
32
33
33
34
export interface FeaturesList extends LazyFeatures {
34
- cleanup ;
35
+ cleanup : InstanceType < typeof FirebaseFunctionsTest > [ 'cleanup' ] ;
35
36
}
Original file line number Diff line number Diff line change @@ -24,16 +24,19 @@ import { AppOptions } from 'firebase-admin';
24
24
import { merge } from 'lodash' ;
25
25
26
26
import { FirebaseFunctionsTest } from './lifecycle' ;
27
- import { features as lazyFeatures , FeaturesList } from './features' ;
27
+ import { FeaturesList } from './features' ;
28
28
29
- export = ( firebaseConfig ?: AppOptions , pathToServiceAccountKey ?: string ) => {
29
+ export = (
30
+ firebaseConfig ?: AppOptions ,
31
+ pathToServiceAccountKey ?: string
32
+ ) : FeaturesList => {
30
33
const test = new FirebaseFunctionsTest ( ) ;
31
34
test . init ( firebaseConfig , pathToServiceAccountKey ) ;
32
35
// Ensure other files get loaded after init function, since they load `firebase-functions`
33
36
// which will issue warning if process.env.FIREBASE_CONFIG is not yet set.
34
- let features = require ( './features' ) . features as typeof lazyFeatures ;
37
+ let features = require ( './features' ) . features ;
35
38
features = merge ( { } , features , {
36
39
cleanup : ( ) => test . cleanup ( ) ,
37
40
} ) ;
38
- return features as FeaturesList ;
41
+ return features ;
39
42
} ;
You can’t perform that action at this time.
0 commit comments