Skip to content
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

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

Open
ginovva320 opened this issue Sep 25, 2015 · 0 comments
Open

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

ginovva320 opened this issue Sep 25, 2015 · 0 comments

Comments

@ginovva320
Copy link

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]
       }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant