map.resize, close server after tests, not inside

This commit is contained in:
Mike Morris
2015-04-27 15:19:37 -04:00
parent 840e22bf90
commit 3eb8ec9ca6
2 changed files with 7 additions and 5 deletions

View File

@@ -199,7 +199,7 @@ NAN_METHOD(NodeMap::Render) {
}
void NodeMap::startRender(std::unique_ptr<NodeMap::RenderOptions> options) {
view.resize(options->width, options->height, options->ratio);
map.resize(options->width, options->height, options->ratio);
map.setClasses(options->classes);
map.setLatLngZoom(mbgl::LatLng(options->latitude, options->longitude), options->zoom);
map.setBearing(options->bearing);

View File

@@ -2,7 +2,7 @@
/* jshint node: true */
var test = require('tape');
var test = require('tape').test;
var mbgl = require('../..');
var fs = require('fs');
var path = require('path');
@@ -117,14 +117,14 @@ test('gzip', function(t) {
if (process.env.UPDATE) {
fs.writeFile(filename.expected, image, function(err) {
t.error(err);
server.close(t.end);
t.end();
});
} else {
fs.writeFile(filename.actual, image, function(err) {
t.error(err);
compare(filename.actual, filename.expected, filename.diff, t, function(error, difference) {
t.ok(difference <= 0.001, 'actual matches expected');
server.close(t.end);
t.end();
});
});
}
@@ -133,5 +133,7 @@ test('gzip', function(t) {
});
});
t.end();
t.test('teardown', function(t) {
server.close(t.end);
});
});