diff --git a/tests/selenium.js b/tests/selenium.js index cab09a6..d6f154f 100644 --- a/tests/selenium.js +++ b/tests/selenium.js @@ -172,11 +172,13 @@ browserStream.push(result.browser); }); - resultStream.onEnd(function() { - browser.quit(); + return resultStream.fold([], pushToArray).flatMap(function(value) { + return Bacon.fromCallback(function(callback) { + browser.quit(function() { + callback(value); + }); + }); }); - - return resultStream.fold([], pushToArray); } function createImages(data) {