The test code should compile fine and the test should run without any issues.
In addition to this, it would be really nice if there would exist example(s) on how to test onCall functions. Now I had to piece this together by combining different examples and the migration docs.
Actual behavior
I get the following error when using wrap for the function: Argument of type 'CallableFunction<string, string>' is not assignable to parameter of type 'CloudFunction<CloudEvent<unknown>>'. The error message changes slightly if I remove the type annotation, but the end result is the same. Also, the wrap function seems to return a gen1 wrapped function, not a gen2 one, at least if Intellisense it to be trusted, which causes another TS compilation error for the call on the next line: Argument of type 'string' is not assignable to parameter of type 'CallableRequest<string>'.
Version info
firebase-functions-test: 3.1.0
firebase-functions: 4.4.0
firebase-admin: 11.0.1
Test case
A bit unsure if this is a bug or a feature request :)
Add the following code to the sample
test-functions-jest-ts
A gen2 onCall function:
And unit test:
Steps to reproduce
See the code snippet above.
Expected behavior
The test code should compile fine and the test should run without any issues.
In addition to this, it would be really nice if there would exist example(s) on how to test
onCall
functions. Now I had to piece this together by combining different examples and the migration docs.Actual behavior
I get the following error when using
wrap
for the function:Argument of type 'CallableFunction<string, string>' is not assignable to parameter of type 'CloudFunction<CloudEvent<unknown>>'
. The error message changes slightly if I remove the type annotation, but the end result is the same. Also, thewrap
function seems to return a gen1 wrapped function, not a gen2 one, at least if Intellisense it to be trusted, which causes another TS compilation error for the call on the next line:Argument of type 'string' is not assignable to parameter of type 'CallableRequest<string>'
.