Permalink
Browse files

test: add #1634 test case

  • Loading branch information...
1 parent 3bf20e4 commit 3efebbe22520497ace75d967b8ef58b4bf10c7ec @bnoordhuis committed Sep 3, 2011
Showing with 9 additions and 0 deletions.
  1. +9 −0 test/simple/test-util-inspect.js
@@ -26,6 +26,15 @@ var common = require('../common');
var assert = require('assert');
var util = require('util');
+// exceptions should print the error message, not "{}"
+var ex;
+ex = util.inspect(new Error('FAIL'));
+assert.ok(ex.indexOf("[message]: 'FAIL'") != -1);
+ex = util.inspect(new TypeError('FAIL'));
+assert.ok(ex.indexOf("[message]: 'FAIL'") != -1);
+ex = util.inspect(new SyntaxError('FAIL'));
+assert.ok(ex.indexOf("[message]: 'FAIL'") != -1);
+
// test the internal isDate implementation
var Date2 = require('vm').runInNewContext('Date');
var d = new Date2();

0 comments on commit 3efebbe

Please sign in to comment.