From ee8506a171776696f95b36c9b842f9957dc95640 Mon Sep 17 00:00:00 2001 From: Brian Cavalier Date: Fri, 5 Jul 2013 09:59:25 -0400 Subject: [PATCH] Make aggregator test safe for envs that don't have console --- test/monitor/aggregator-test.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/monitor/aggregator-test.js b/test/monitor/aggregator-test.js index 2c2d3944..a69a7795 100644 --- a/test/monitor/aggregator-test.js +++ b/test/monitor/aggregator-test.js @@ -9,15 +9,16 @@ sentinel = { value: 'sentinel' }; define('when/monitor/aggregator-test', function (require) { - var when, aggregator; + var when, aggregator, monitor; when = require('when'); aggregator = require('when/monitor/aggregator'); + monitor = typeof console != 'undefined' ? console : when; buster.testCase('when/monitor/aggregator', { 'tearDown': function() { - if(typeof console.PromiseStatus === 'function') { - delete console.PromiseStatus; + if(typeof monitor.PromiseStatus === 'function') { + delete monitor.PromiseStatus; } }, @@ -32,7 +33,7 @@ define('when/monitor/aggregator-test', function (require) { assert.same(promises[key].reason, sentinel); } done(); - }).publish(console); + }).publish(monitor); when.promise(function(_, reject) { reject(sentinel); @@ -47,7 +48,7 @@ define('when/monitor/aggregator-test', function (require) { assert.same(promises[key].reason, sentinel); } done(); - }).publish(console); + }).publish(monitor); when.defer().reject(sentinel); }