File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -179,20 +179,23 @@ describe('#onCall', () => {
179
179
// Regression test for firebase-functions#947
180
180
it ( 'should lock to the v1 API even with function.length == 1' , async ( ) => {
181
181
let gotData : Record < string , any > ;
182
- const func = https . onCall ( data => {
182
+ const func = https . onCall ( ( data ) => {
183
183
gotData = data ;
184
184
} ) ;
185
185
186
- const req = new MockRequest ( {
187
- data : { "foo" : "bar" } ,
188
- } , {
189
- "content-type" : "application/json" ,
190
- } ) ;
191
- req . method = "POST" ;
186
+ const req = new MockRequest (
187
+ {
188
+ data : { foo : 'bar' } ,
189
+ } ,
190
+ {
191
+ 'content-type' : 'application/json' ,
192
+ }
193
+ ) ;
194
+ req . method = 'POST' ;
192
195
193
196
const response = await runHandler ( func , req as any ) ;
194
197
expect ( response . status ) . to . equal ( 200 ) ;
195
- expect ( gotData ) . to . deep . equal ( { " foo" : " bar" } ) ;
198
+ expect ( gotData ) . to . deep . equal ( { foo : ' bar' } ) ;
196
199
} ) ;
197
200
} ) ;
198
201
Original file line number Diff line number Diff line change @@ -80,7 +80,8 @@ export function _onCallWithOptions(
80
80
// onCallHandler sniffs the function length of the passed-in callback
81
81
// and the user could have only tried to listen to data. Wrap their handler
82
82
// in another handler to avoid accidentally triggering the v2 API
83
- const fixedLen = ( data : any , context : CallableContext ) => handler ( data , context ) ;
83
+ const fixedLen = ( data : any , context : CallableContext ) =>
84
+ handler ( data , context ) ;
84
85
const func : any = onCallHandler ( { origin : true , methods : 'POST' } , fixedLen ) ;
85
86
86
87
func . __trigger = {
You can’t perform that action at this time.
0 commit comments