forked from mapnik/node-mapnik
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcairo_surface.test.js
More file actions
26 lines (22 loc) · 853 Bytes
/
Copy pathcairo_surface.test.js
File metadata and controls
26 lines (22 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"use strict";
var test = require('tape');
var mapnik = require('../');
test('should throw with invalid usage', (assert) => {
// no 'new' keyword
assert.throws(function() { mapnik.CairoSurface(1, 1); });
// invalid args
assert.throws(function() { new mapnik.CairoSurface(); });
assert.throws(function() { new mapnik.CairoSurface(1); });
assert.throws(function() { new mapnik.CairoSurface('foo'); });
assert.throws(function() { new mapnik.CairoSurface('a', 'b', 'c'); });
assert.throws(function() { new mapnik.CairoSurface(1, 'b', 'c'); });
assert.end();
});
test('should be initialized properly', (assert) => {
var im = new mapnik.CairoSurface('SVG',256, 256);
assert.ok(im instanceof mapnik.CairoSurface);
assert.equal(im.width(), 256);
assert.equal(im.height(), 256);
assert.equal(im.getData(), '');
assert.end();
});