Skip to content

Nodes with values set to null should not be created #95

Description

@ginovva320

I'm running across this issue with both set and update. If part of the submitted data contains a new node whose value is null, the mock data returned includes that node when it should not. Here's a sample test to demonstrate:

test/unit/firebase.js:

describe('#set', function () {
    beforeEach(function () {
      ref.autoFlush();
    });

    it('should not create children which have null values', function() {
      var dataToSet = {
          a: 'test',
          f: null
        },
        dataToExpect = {
          a: 'test'
        };

      ref.set(dataToSet);

      expect(ref.getData()).to.deep.equal(dataToExpect);
    });
});

output:

1) MockFirebase #set should not create children which have null values:

      AssertionError: expected { a: 'test', f: null } to deeply equal { a: 'test' }
      + expected - actual

       {
         "a": "test"
      -  "f": [null]
       }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions