forked from mapnik/node-mapnik
-
Notifications
You must be signed in to change notification settings - Fork 2
/
logger.test.js
30 lines (24 loc) · 927 Bytes
/
logger.test.js
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
27
28
29
30
"use strict";
var test = require('tape');
var mapnik = require('../');
test('get_severity should return default', (assert) => {
assert.equal(mapnik.Logger.getSeverity(), mapnik.Logger.ERROR);
assert.end();
});
test('test that you cant initialize a logger', (assert) => {
assert.throws(function() { var l = new mapnik.Logger(); });
assert.end();
});
test('set_severity should fail with bad input', (assert) => {
assert.throws(function() { mapnik.Logger.setSeverity(); });
assert.throws(function() { mapnik.Logger.setSeverity(null); });
assert.throws(function() { mapnik.Logger.setSeverity(2,3); });
assert.end();
});
test('set_severity should set mapnik.logger', (assert) => {
var orig_severity = mapnik.Logger.getSeverity();
mapnik.Logger.setSeverity(mapnik.Logger.NONE);
assert.equal(mapnik.Logger.getSeverity(), mapnik.Logger.NONE);
mapnik.Logger.setSeverity(orig_severity);
assert.end();
});