Skip to content

Commit abc654d

Browse files
authored
Support ref.push() without arguments
The example in the docs shows this use: https://firebase.google.com/docs/reference/js/firebase.database.Reference#push Calling .push() should create a child and return a reference to it. Currently you're returning null, so it looks like a pretty small change to support this behaviour.
1 parent 75631cb commit abc654d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/firebase.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ MockFirebase.prototype.push = function (data, callback) {
240240
validate.data(data);
241241
return utils.createThenableReference(child, child.set(data, callback));
242242
} else {
243-
return utils.createThenableReference(child, Promise.resolve(null));
243+
return utils.createThenableReference(child, Promise.resolve(child));
244244
}
245245
};
246246

0 commit comments

Comments
 (0)