From 6165023a9593f4f69fe342761b8b2d75923baf7a Mon Sep 17 00:00:00 2001 From: Angel Yordanov Date: Mon, 16 Dec 2013 16:07:33 +0200 Subject: [PATCH] feat(runner): return a promise from runner.runOnce In some cases knowing when the runner has finished is a requirement (e.g. an async grunt task). --- lib/runner.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/runner.js b/lib/runner.js index 9ca5c0e17..369c4e3df 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -304,12 +304,12 @@ var runJasmineTests = function() { * Run Protractor once. */ var runOnce = function() { - setUpSelenium().then(function() { + return setUpSelenium().then(function() { // cleanUp must be registered directly onto runJasmineTests, not onto // the chained promise, so that cleanUp is still called in case of a // timeout error. Timeout errors need to clear the control flow, which // would mess up chaining promises. - runJasmineTests().then(cleanUp); + return runJasmineTests().then(cleanUp); }); };