Description:
when setting a value of DatabaseReference to null using update, FirebaseDatabase removes this value from the database.
MockDatabaseReference.update inserts a null value instead
How to reproduce:
test('MockDatabaseReference removes value when updating with null', () async {
DatabaseReference reference = MockFirebaseDatabase.instance.ref('path'); // test works with FirebaseDatabase.instance.ref('path')
await reference.update({'x':'value'});
var snapshot = await reference.get();
expect(snapshot.value, {'x':'value'});
await reference.update({'x':null}); // should remove the entry
snapshot = await reference.get();
expect(snapshot.value, null); // this fails, actual: {'x':null}
});