-
Notifications
You must be signed in to change notification settings - Fork 59
fix(wrap): Extensions functions.handler
-> eventType
key exists but is undefined
value
#49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(wrap): Extensions functions.handler
-> eventType
key exists but is undefined
value
#49
Conversation
On Firebase Extensions when wrapping an exported Firestore onWrite fn it errors with `Cannot read property 'match' of undefined`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix! there seems to be some TS errors
node_modules/@types/chai/index.d.ts:121:9 - error TS8020: JSDoc types can only be used inside documentation comments.
121 any?, // actual value
~~~~
node_modules/@types/chai/index.d.ts:122:9 - error TS8020: JSDoc types can only be used inside documentation comments.
122 boolean? // showDiff
~~~~~~~~
node_modules/@types/chai/index.d.ts:126:16 - error TS2370: A rest parameter must be of an array type.
126 assert(...args: AssertionArgs): void;
~~~~~~~~~~~~~~~~~~~~~~
These are on master too - but I'll look into it, thanks! |
Looks like theres a breaking change in a minor release of the chai types.
Node.js 6 is no longer supported by the newer `firebase-functions` versions as it uses `async/await` which is only supported in version 8+
@laurenzlong fixed the types issue that was on master - breaking change in the Came across another issue after though with the dev dependencies; the I also had to remove Node.js v6 testing from travis - newer Hope these additional changes to get CI working again are ok? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for my delayed review! This looks awesome! Thanks for fixing so many things!
@Salakar This has now been released in v0.1.7 |
@laurenzlong Thank you 🎉 |
Description
I've been working on adding tests to firebase/extensions and when trying to wrap the function handlers used by Extensions (e.g.
functions.handler.firestore.document.onWrite
) it errors withTypeError: Cannot read property 'match' of undefined
as theeventType
key 'does' exist on thedefaultContext
object, but has anundefined
value assigned.This small PR adds an additional
undefined
check.Before:

After:

Code sample
N/A
cc @laurenzlong @karayu