-
Notifications
You must be signed in to change notification settings - Fork 86
Open
Description
I read about this test and don't understand why exist.
it('should ignore invalid arguments safely', function(){
var obj = {};
// 1
expect(objectPath.empty()).to.equal(void 0);
// 2
expect(objectPath.empty(obj, 'path')).to.equal(void 0);
// 3
expect(objectPath.empty(obj, '')).to.equal(obj);
obj.path = true;
// 4
expect(objectPath.empty(obj, 'inexistant')).to.equal(obj);
});
2nd an 4th assertions are essentialy the same thing.
In second assertion `obj` is an object and `path` property does not exist in `obj`.
In fourth assertion `obj` is an object and `existant` property does not exist in `obj`
I think that it should return the same value `undefined` or the same `object` passed.
Metadata
Metadata
Assignees
Labels
No labels