diff --git a/lib/util.js b/lib/util.js index 21366ef91..ddf25105e 100644 --- a/lib/util.js +++ b/lib/util.js @@ -1,7 +1,6 @@ var q = require('q'), - path = require('path'), - webdriver = require('selenium-webdriver'); - + path = require('path'); + var STACK_SUBSTRINGS_TO_FILTER = [ 'node_modules/minijasminenode/lib/', 'node_modules/selenium-webdriver', @@ -52,9 +51,7 @@ exports.runFilenameOrFn_ = function(configDir, filenameOrFn, args) { filenameOrFn = require(path.resolve(configDir, filenameOrFn)); } if (typeof filenameOrFn === 'function') { - var results = webdriver.promise.controlFlow().execute(function() { - return filenameOrFn.apply(null, args); - }, 'executing onPrepare').then(null, function(err) { + var results = q.when(filenameOrFn.apply(null, args), null, function(err) { err.stack = exports.filterStackTrace(err.stack); throw err; });