From f973eaa24d69d952ed5d8846079e2eaaf109b047 Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Mon, 24 Oct 2016 10:39:48 +0200 Subject: [PATCH] Test that ol.obj.assign throws on undefined/null --- test/spec/ol/objectutil.test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/spec/ol/objectutil.test.js b/test/spec/ol/objectutil.test.js index 7b5204021b..0c29f620fd 100644 --- a/test/spec/ol/objectutil.test.js +++ b/test/spec/ol/objectutil.test.js @@ -31,6 +31,18 @@ describe('ol.obj.assign()', function() { }); + it('throws a TypeError with `undefined` as target', function() { + expect(ol.obj.assign).withArgs(undefined).to.throwException(function(e) { + expect(e).to.be.a(TypeError); + }); + }); + + it('throws a TypeError with `null` as target', function() { + expect(ol.obj.assign).withArgs(null).to.throwException(function(e) { + expect(e).to.be.a(TypeError); + }); + }); + }); describe('ol.obj.clear()', function() {