From 0f4ce6acc14acb518cc2031af625aa71bb3f5bf9 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Sun, 4 Dec 2011 11:38:24 -0500 Subject: [PATCH] Warning test workaround for FF - Note that warnings do work properly in practice in FF --- test/test-warn-exception.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/test-warn-exception.js b/test/test-warn-exception.js index c0fa30a..dbc547c 100644 --- a/test/test-warn-exception.js +++ b/test/test-warn-exception.js @@ -67,8 +67,14 @@ var common = require( './common' ), */ ( function testCanWarningMessageIsSetFromWrappedException() { - var err = Error( 'oshit' ), - warning = Warning( err ); + var err = Error( 'oshit' ); + + // bug in FF (tested with 8.0) where, without accessing the message property + // in this test before passing it to Warning, err.message === "" within the + // Warning ctor. + err.message; + + var warning = Warning( err ); assert.equal( warning.message, err.message, "Warning message should be taken from wrapped exception"