map.resize, close server after tests, not inside
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user