You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Even though change.after does correctly reference only the field that changed, when trying to get it's parent null is returned instead of the value in the beforeSnap
Expected behavior
The correct parent ref is detected or at least there is a way to set it so the real firebase behavior can be replicated
Actual behavior
The ref's parent is set to null, which diverges from real firebase behavior
The text was updated successfully, but these errors were encountered:
Version info
firebase-functions-test: 0.2.3
firebase-functions: 3.12.0
firebase-admin: 9.4.1
Test case
Assume the following firebase function that triggers on a sub-field change:
Now to write a unit test for such function:
Steps to reproduce
So, the exact problem occurs on this line:
return change.after.ref.parent?.once('value').then(snapshot => {
Even though
change.after
does correctly reference only the field that changed, when trying to get it's parentnull
is returned instead of the value in thebeforeSnap
Expected behavior
The correct parent ref is detected or at least there is a way to set it so the real firebase behavior can be replicated
Actual behavior
The ref's parent is set to null, which diverges from real firebase behavior
The text was updated successfully, but these errors were encountered: