[node] Add test that explicitly doesn call map.release()

Make sure mbgl.Map is not holding any references to the node's main
loop and thus preventing the node from exit.
This commit is contained in:
Thiago Marcos P. Santos
2016-02-23 15:31:47 +02:00
parent 63982e0010
commit 46557874ec

View File

@@ -323,5 +323,21 @@ test('Map', function(t) {
t.end();
});
});
t.test('not holding references', function(t) {
var options = {
request: function() {},
ratio: 1
};
// We explicitly don't call release. mbgl.Map should
// not hold any reference to the node's main loop and
// prevent the test from exit.
var map1 = new mbgl.Map(options);
var map2 = new mbgl.Map(options);
var map3 = new mbgl.Map(options);
t.end();
});
});
});