Skip to content
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.

Commit

Permalink
Added functional test for merge() removing null values.
Browse files Browse the repository at this point in the history
  • Loading branch information
davepgreene committed Jun 7, 2017
1 parent e2260b5 commit 202e5a5
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,34 @@ describe('Properties', function() {
properties.build();
});

it('removes properties that have null values', function(done) {
const properties = new Properties();

properties.static({
cruel: 'world',
leaving: null,
change: 'my-mind'
}, 'goodbye');

const stub = new Source.Stub();

stub.properties = {
stubby: null
};

properties.dynamic(stub);

properties.once('build', (props) => {
expect(props.goodbye.cruel).to.equal('world');
expect(props.goodbye.leaving).to.be.an('undefined');
expect(props.goodbye.change).to.equal('my-mind');
expect(props.stubby).to.be.an('undefined');
done();
});

properties.build();
});

it('adds a dynamic layer and rebuilds on updates', function(done) {
const stub = new Source.Stub();

Expand Down

0 comments on commit 202e5a5

Please sign in to comment.