forked from CartoDB/node-mapnik
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogger.test.js
30 lines (24 loc) · 1021 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 mapnik = require('../');
var assert = require('assert');
describe('logger', function() {
it('get_severity should return default', function(done) {
assert.equal(mapnik.Logger.getSeverity(), mapnik.Logger.ERROR);
done();
});
it('test that you cant initialize a logger', function() {
assert.throws(function() { var l = new mapnik.Logger(); });
});
it('set_severity should fail with bad input', function() {
assert.throws(function() { mapnik.Logger.setSeverity(); });
assert.throws(function() { mapnik.Logger.setSeverity(null); });
assert.throws(function() { mapnik.Logger.setSeverity(2,3); });
});
it('set_severity should set mapnik.logger', function(done) {
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);
done();
});
});