[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.
This commit is contained in:
John Firebaugh
2015-11-18 15:26:43 -08:00
parent f2772309fe
commit 46a6b03582

View File

@@ -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');