Skip to content

Commit

Permalink
[node] Not all tests were calling map.release()
Browse files Browse the repository at this point in the history
Which prevents the test runner to close.
  • Loading branch information
tmpsantos committed Feb 20, 2016
1 parent 3633fd7 commit 8219d72
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions platform/node/test/js/map.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ test('Map', function(t) {

options.request = function() {};
t.doesNotThrow(function() {
new mbgl.Map(options);
var map = new mbgl.Map(options);
map.release();
});

t.end();
Expand All @@ -59,7 +60,8 @@ test('Map', function(t) {

options.cancel = function() {};
t.doesNotThrow(function() {
new mbgl.Map(options);
var map = new mbgl.Map(options);
map.release();
});

t.end();
Expand All @@ -78,7 +80,8 @@ test('Map', function(t) {

options.ratio = 1.0;
t.doesNotThrow(function() {
new mbgl.Map(options);
var map = new mbgl.Map(options);
map.release();
});

t.end();
Expand Down Expand Up @@ -300,6 +303,7 @@ test('Map', function(t) {
});
map.load(style);
map.render({ zoom: 1 }, function(err, data) {
map.release();
t.ok(err, 'returns error');
t.equal(err.message, 'request error');
t.end();
Expand All @@ -314,6 +318,7 @@ test('Map', function(t) {
});
map.load(style);
map.render({ zoom: 1 }, function(err, data) {
map.release();
t.ok(data, 'no error');
t.end();
});
Expand Down

0 comments on commit 8219d72

Please sign in to comment.