97c1e2847abd4c9736dfe8d7eb37c69320ef1195.svn-base
1.34 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* exception-test.js: Tests for exception data gathering in winston.
*
* (C) 2010 Charlie Robbins
* MIT LICENSE
*
*/
var path = require('path'),
vows = require('vows'),
assert = require('assert'),
winston = require('../lib/winston'),
helpers = require('./helpers');
vows.describe('winston/exception').addBatch({
"When using the winston exception module": {
"the getProcessInfo() method": {
topic: winston.exception.getProcessInfo(),
"should respond with the appropriate data": function (info) {
helpers.assertProcessInfo(info);
}
},
"the getOsInfo() method": {
topic: winston.exception.getOsInfo(),
"should respond with the appropriate data": function (info) {
helpers.assertOsInfo(info);
}
},
"the getTrace() method": {
topic: winston.exception.getTrace(new Error()),
"should have the appropriate info": function (trace) {
helpers.assertTrace(trace);
}
},
"the getAllInfo() method": {
topic: winston.exception.getAllInfo(new Error()),
"should have the appropriate info": function (info) {
assert.isObject(info);
assert.isArray(info.stack);
helpers.assertProcessInfo(info.process);
helpers.assertOsInfo(info.os);
helpers.assertTrace(info.trace);
}
}
}
}).export(module);