test case for _.forOwn

This commit is contained in:
harttle
2018-07-21 23:23:25 +08:00
parent c3e7859cdd
commit 14d1956232
+5
View File
@@ -43,6 +43,11 @@ describe('util/underscore', function () {
_.forOwn(obj, spy)
expect(spy).to.have.been.calledWith('bar', 'foo', obj)
})
it('should default to empty object', function () {
var spy = sinon.spy()
_.forOwn(undefined, spy)
expect(spy).to.have.not.been.called
})
it('should not iterate over properties on prototype', function () {
var spy = sinon.spy()
var obj = Object.create({