Files
MapLibreParticleLab/platform/node/test/render.test.js
Mike Morris 1296f91c82 [node] change request semantics
Passes a second, callback argument to the request implementation instead
of needing to call req.respond.
2015-09-10 15:58:29 -04:00

29 lines
719 B
JavaScript

'use strict';
var mbgl = require('../../..');
var suite = require('mapbox-gl-test-suite');
var request = require('request');
var tests;
if (process.argv[1] === __filename && process.argv.length > 2) {
tests = process.argv.slice(2);
}
suite.run('native', {tests: tests}, function (style, options, callback) {
var map = new mbgl.Map({
ratio: options.pixelRatio,
request: function(req, callback) {
request(req.url, {encoding: null}, function (err, response, body) {
callback(err, {data: body});
});
}
});
map.load(style);
map.render(options, function (err, pixels) {
map.release();
callback(err, pixels);
});
});