@@ -18,24 +18,26 @@ describe('extractStack', () => {
18
18
httpsTrigger : { } ,
19
19
} ;
20
20
21
+ const callableFn = functions . https . onCall ( ( ) => { } ) ;
22
+ const callableEndpoint = {
23
+ platform : 'gcfv1' ,
24
+ labels : { } , // TODO: empty labels?
25
+ callableTrigger : { } ,
26
+ } ;
27
+
21
28
it ( 'extracts stack from a simple module' , ( ) => {
22
29
const module = {
23
30
http : httpFn ,
24
- callable : functions . https . onCall ( ( ) => { } ) ,
31
+ callable : callableFn ,
25
32
} ;
26
33
27
34
const endpoints : Record < string , ManifestEndpoint > = { } ;
28
35
const requiredAPIs : Record < string , ManifestRequiredAPI > = { } ;
29
36
loader . extractStack ( module , endpoints , requiredAPIs ) ;
30
37
31
38
expect ( endpoints ) . to . be . deep . equal ( {
32
- http : { entryPoint : 'http' , ...httpEndpoint } ,
33
- callable : {
34
- entryPoint : 'callable' ,
35
- platform : 'gcfv1' ,
36
- labels : { } , // TODO: empty labels?
37
- callableTrigger : { } ,
38
- } ,
39
+ http : { entryPoint : 'http' , ...httpEndpoint } ,
40
+ callable : { entryPoint : 'callable' , ...callableEndpoint } ,
39
41
} ) ;
40
42
41
43
expect ( requiredAPIs ) . to . be . empty ;
@@ -68,9 +70,9 @@ describe('extractStack', () => {
68
70
69
71
it ( 'extracts stack from a module with group functions' , ( ) => {
70
72
const module = {
71
- fn1 : annotatedFn ( HTTP_ENDPOINT ) ,
73
+ fn1 : httpFn ,
72
74
g1 : {
73
- fn2 : annotatedFn ( EVENT_ENDPOINT ) ,
75
+ fn2 : httpFn ,
74
76
} ,
75
77
} ;
76
78
@@ -80,11 +82,11 @@ describe('extractStack', () => {
80
82
expect ( endpoints ) . to . be . deep . equal ( {
81
83
fn1 : {
82
84
entryPoint : 'fn1' ,
83
- ...HTTP_ENDPOINT ,
85
+ ...httpEndpoint ,
84
86
} ,
85
87
'g1-fn2' : {
86
88
entryPoint : 'g1.fn2' ,
87
- ...EVENT_ENDPOINT ,
89
+ ...httpEndpoint ,
88
90
} ,
89
91
} ) ;
90
92
} ) ;
@@ -112,7 +114,7 @@ describe('extractStack', () => {
112
114
loader . extractStack ( module , endpoints , requiredAPIs ) ;
113
115
114
116
expect ( endpoints ) . to . be . deep . equal ( {
115
- http : {
117
+ fn : {
116
118
entryPoint : 'fn' ,
117
119
platform : 'gcfv1' ,
118
120
eventTrigger : {
0 commit comments