firebase / firebase-functions-test

MIT License
232 stars 48 forks source link

Update mockConfig function for v4 firebase-functions #173

Closed taeold closed 1 year ago

taeold commented 1 year ago

V4 Functions SDK does not expose the config singleton directly.

Use the internal-only resetCache function instead.

taeold commented 1 year ago

@inlined stripInternal compiler option doesn't remove the javascript code:

https://www.typescriptlang.org/tsconfig#stripInternal

It is still available for use. I did have to make tsc happy by using @ts-ignore.

Proof:

$ node
> require("firebase-functions").resetCache
[Function: resetCache]
taeold commented 1 year ago

Tests are broken because v4 sdk isn't available yet. This will be fixed in future PR where I pull in release candidate version as the dev dependency.