From afa7cb6159cef2f071f72bda52bdb14c159c1d72 Mon Sep 17 00:00:00 2001 From: Emily Stark Date: Mon, 12 Aug 2013 12:20:23 -0700 Subject: [PATCH] Log exceptions on tests run with test-in-console. Also counts exceptions as failures and removes unused finished var. --- packages/test-in-console/driver.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/test-in-console/driver.js b/packages/test-in-console/driver.js index cbbd26b354..50e03156f3 100644 --- a/packages/test-in-console/driver.js +++ b/packages/test-in-console/driver.js @@ -21,7 +21,6 @@ var log = function (/*arguments*/) { }; -var finished = 0; var passed = 0; var failed = 0; var expected = 0; @@ -96,6 +95,14 @@ Meteor.startup(function () { if (resultSet[name].status !== "FAIL") resultSet[name].status = "EXPECTED"; break; + case "exception": + log(name, ":", "!!!!!!!!! FAIL !!!!!!!!!!!"); + if (event.details && event.details.stack) + log(event.details.stack); + else + log("Test failed with exception"); + failed++; + break; case "finish": switch (resultSet[name].status) { case "OK": @@ -120,7 +127,6 @@ Meteor.startup(function () { default: log(name, ": unknown state for the test to be in"); } - finished++; break; default: resultSet[name].status = "FAIL";