From 46557874ec1e48d53461cd947cc7180e702de5ba Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Tue, 23 Feb 2016 15:31:47 +0200 Subject: [PATCH] [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. --- platform/node/test/js/map.test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/platform/node/test/js/map.test.js b/platform/node/test/js/map.test.js index 48bd6fe65..122890094 100644 --- a/platform/node/test/js/map.test.js +++ b/platform/node/test/js/map.test.js @@ -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(); + }); }); });