Skip to content

Commit

Permalink
[test] Test that exception contains correct date info
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalecki committed May 24, 2012
1 parent 793d6b3 commit 3a0978a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/exception-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ vows.describe('winston/exception').addBatch({
"should have the appropriate info": function (info) {
assert.isObject(info);
assert.isArray(info.stack);
helpers.assertDateInfo(info.date);
helpers.assertProcessInfo(info.process);
helpers.assertOsInfo(info.os);
helpers.assertTrace(info.trace);
}
}
}
}).export(module);
}).export(module);
4 changes: 4 additions & 0 deletions test/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ helpers.tryUnlink = function (file) {
catch (ex) { }
};

helpers.assertDateInfo = function (info) {
assert.isNumber(Date.parse(info));
};

helpers.assertProcessInfo = function (info) {
assert.isNumber(info.pid);
assert.isNumber(info.uid);
Expand Down

0 comments on commit 3a0978a

Please sign in to comment.