From a7bdc49830798e5d4caeeb9cf2a2e32cc1ce5a9b Mon Sep 17 00:00:00 2001 From: Lucas Wojciechowski Date: Fri, 22 Jul 2016 08:09:29 -0400 Subject: [PATCH 1/2] Fix failing unit test --- test/js/ui/map.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/js/ui/map.test.js b/test/js/ui/map.test.js index 4dbd07c9156..2a64ce6f678 100755 --- a/test/js/ui/map.test.js +++ b/test/js/ui/map.test.js @@ -894,13 +894,13 @@ test('Map', function(t) { t.test('calls listeners', function (t) { sinon.stub(console, 'error', function() { - console.error.restore(); t.fail(); }); var map = createMap({ style: { version: 8, sources: {}, layers: [] } }); map.on('error', function(event) { t.equal(event.error.message, 'version: expected one of [8], 7 found'); + console.error.restore(); t.end(); }); map.setStyle({ version: 7, sources: {}, layers: [] }); From fc189df0a7195d07621a7cc873f98f25ef28b61c Mon Sep 17 00:00:00 2001 From: Lucas Wojciechowski Date: Fri, 22 Jul 2016 08:57:14 -0400 Subject: [PATCH 2/2] Improve failing test debug output --- test/js/ui/map.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/js/ui/map.test.js b/test/js/ui/map.test.js index 2a64ce6f678..745c07b6fcb 100755 --- a/test/js/ui/map.test.js +++ b/test/js/ui/map.test.js @@ -893,8 +893,8 @@ test('Map', function(t) { }); t.test('calls listeners', function (t) { - sinon.stub(console, 'error', function() { - t.fail(); + sinon.stub(console, 'error', function(event) { + t.fail(event.error); }); var map = createMap({ style: { version: 8, sources: {}, layers: [] } });