From 3efebbe22520497ace75d967b8ef58b4bf10c7ec Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sat, 3 Sep 2011 03:20:10 +0200 Subject: [PATCH] test: add #1634 test case --- test/simple/test-util-inspect.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/simple/test-util-inspect.js b/test/simple/test-util-inspect.js index 717182f88de9..cd39c3725c0a 100644 --- a/test/simple/test-util-inspect.js +++ b/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();