Skip to content

Commit

Permalink
test: add nodejs#1634 test case
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis committed Sep 3, 2011
1 parent 3bf20e4 commit 3efebbe
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/simple/test-util-inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 3efebbe

Please sign in to comment.