Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Avatar for KuCalc : devops.
Download
50659 views
1
/*
2
* exception-test.js: Tests for exception data gathering in winston.
3
*
4
* (C) 2010 Charlie Robbins
5
* MIT LICENSE
6
*
7
*/
8
9
var path = require('path'),
10
vows = require('vows'),
11
assert = require('assert'),
12
winston = require('../lib/winston'),
13
helpers = require('./helpers');
14
15
vows.describe('winston/exception').addBatch({
16
"When using the winston exception module": {
17
"the getProcessInfo() method": {
18
topic: winston.exception.getProcessInfo(),
19
"should respond with the appropriate data": function (info) {
20
helpers.assertProcessInfo(info);
21
}
22
},
23
"the getOsInfo() method": {
24
topic: winston.exception.getOsInfo(),
25
"should respond with the appropriate data": function (info) {
26
helpers.assertOsInfo(info);
27
}
28
},
29
"the getTrace() method": {
30
topic: winston.exception.getTrace(new Error()),
31
"should have the appropriate info": function (trace) {
32
helpers.assertTrace(trace);
33
}
34
},
35
"the getAllInfo() method": {
36
topic: winston.exception.getAllInfo(new Error()),
37
"should have the appropriate info": function (info) {
38
assert.isObject(info);
39
assert.isArray(info.stack);
40
helpers.assertDateInfo(info.date);
41
helpers.assertProcessInfo(info.process);
42
helpers.assertOsInfo(info.os);
43
helpers.assertTrace(info.trace);
44
}
45
}
46
}
47
}).export(module);
48
49