2 * exception-test.js: Tests for exception data gathering in winston.
4 * (C) 2010 Charlie Robbins
9 var path = require('path'),
10 vows = require('vows'),
11 assert = require('assert'),
12 winston = require('../lib/winston'),
13 helpers = require('./helpers');
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);
23 "the getOsInfo() method": {
24 topic: winston.exception.getOsInfo(),
25 "should respond with the appropriate data": function (info) {
26 helpers.assertOsInfo(info);
29 "the getTrace() method": {
30 topic: winston.exception.getTrace(new Error()),
31 "should have the appropriate info": function (trace) {
32 helpers.assertTrace(trace);
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.assertProcessInfo(info.process);
41 helpers.assertOsInfo(info.os);
42 helpers.assertTrace(info.trace);