-
Notifications
You must be signed in to change notification settings - Fork 61
Closed
Labels
Description
As you can see here https://github.com/firebase/firebase-functions/blob/master/src/providers/https.ts, there's rawRequest: Request;
missing from firebase-functions-test's CallableContextOptions
.
It is not possible to wrap the function with a rawRequest
under the context option because _checkOptionValidity
doesn't pass.
Steps to reproduce
myFunctions = require('../src/index');
const wrapped = testEnv.wrap(myFunctions.bankAccountChange);
const onCallObjects: [any, ContextOptions] = [
{},
{
auth: { uid: '32344', token: { email: 'blab' } },
// @ts-ignore
rawRequest: { headers: { origin: 'url' } },
},
];
await expect(wrapped(...onCallObjects)).rejects.toThrow('There was an error reading the investor data.');
Actual behavior
Throws error:
Options object {"auth":{"uid":"32344","token":{"email":"blab"}},"rawRequest":{"headers":{"origin":"url"}}} has invalid key "rawRequest"