summaryrefslogtreecommitdiff
path: root/platform/node
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2016-02-23 15:31:47 +0200
committerThiago Marcos P. Santos <thiago@mapbox.com>2016-02-24 14:31:11 +0200
commit46557874ec1e48d53461cd947cc7180e702de5ba (patch)
tree8de4c3cda349e774aa35c5d8c7279fdbbc59713a /platform/node
parent63982e001030036e170c306ce51ac71be9a9aa1e (diff)
downloadqtlocation-mapboxgl-46557874ec1e48d53461cd947cc7180e702de5ba.tar.gz
[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.
Diffstat (limited to 'platform/node')
-rw-r--r--platform/node/test/js/map.test.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/platform/node/test/js/map.test.js b/platform/node/test/js/map.test.js
index 48bd6fe65f..1228900940 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();
+ });
});
});