From 99edf8eb722988b88d6c233fee8447f3ab1b6a90 Mon Sep 17 00:00:00 2001 From: Mike Morris Date: Fri, 13 Mar 2015 13:07:33 -0400 Subject: [PATCH] fail if no error is emitted in gzip unhandled test --- test/js/gzip.test.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/js/gzip.test.js b/test/js/gzip.test.js index 6fabc09bd..6a7fda6ea 100644 --- a/test/js/gzip.test.js +++ b/test/js/gzip.test.js @@ -92,8 +92,11 @@ test('gzip', function(t) { }); t.test('unhandled', function(t) { + var errorEmitted = false; + mbgl.on('message', function(msg) { if (msg.severity == 'ERROR') { + errorEmitted = true; t.ok(msg, 'emits error'); t.equal(msg.class, 'ParseTile'); t.equal(msg.severity, 'ERROR'); @@ -104,6 +107,7 @@ test('gzip', function(t) { setup(getFileSource(false, t), function(map) { map.load(style); map.render({}, function(err, image) { + if (!errorEmitted) t.fail('no error emitted'); mbgl.removeAllListeners('message'); mbgl.compressPNG(image, function(err, image) { t.error(err);