fail if no error is emitted in gzip unhandled test

This commit is contained in:
Mike Morris
2015-03-13 13:07:33 -04:00
parent 0c745d6825
commit 99edf8eb72

View File

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