From 46a6b03582e465ef90e72f61eee5c97580ea1042 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 18 Nov 2015 15:26:43 -0800 Subject: [PATCH] [node] Fix race condition in tests The message callback races with the rest of this test. We already have tests for errors being emitted from mbgl, so just remove it. --- platform/node/test/js/map.test.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/platform/node/test/js/map.test.js b/platform/node/test/js/map.test.js index 0ccaa4b55..9c983828f 100644 --- a/platform/node/test/js/map.test.js +++ b/platform/node/test/js/map.test.js @@ -218,17 +218,9 @@ test('Map', function(t) { }); t.test('returns an error', function(t) { - mbgl.on('message', function(msg) { - t.ok(msg, 'emits error'); - t.equal(msg.class, 'Style'); - t.equal(msg.severity, 'ERROR'); - t.ok(msg.text.match(/Failed to load/), 'error text matches'); - }); - var map = new mbgl.Map(options); map.load(style); map.render({ zoom: 1 }, function(err, data) { - mbgl.removeAllListeners('message'); map.release(); t.ok(err, 'returns error');