From a5f0ff7433d65a3604b3c1127659200fa8fbf99a Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Mon, 29 Sep 2014 21:29:44 -0700 Subject: [PATCH] Port the test for console.log multiple arguments. https://github.com/ariya/phantomjs/issues/12439 --- test/run-tests.py | 1 + test/standards/console/console_log.js | 16 ++++++++++++++++ test/webpage-spec.js | 16 ---------------- 3 files changed, 17 insertions(+), 16 deletions(-) create mode 100644 test/standards/console/console_log.js diff --git a/test/run-tests.py b/test/run-tests.py index 9396992b..2eeb9748 100755 --- a/test/run-tests.py +++ b/test/run-tests.py @@ -26,6 +26,7 @@ TESTS = [ 'module/system/*.js', 'module/webpage/*.js', 'standards/javascript/*.js', + 'standards/console/*.js', 'regression/*.js', 'run-tests.js' ] diff --git a/test/standards/console/console_log.js b/test/standards/console/console_log.js new file mode 100644 index 00000000..9a67c377 --- /dev/null +++ b/test/standards/console/console_log.js @@ -0,0 +1,16 @@ +var assert = require('../../assert'); +var webpage = require('webpage'); + +var page = webpage.create(); + +var message; +page.onConsoleMessage = function (msg) { + message = msg; +} + +// console.log should support multiple arguments +page.evaluate(function () { + console.log('answer', 42); +}); + +assert.equal(message, 'answer 42'); diff --git a/test/webpage-spec.js b/test/webpage-spec.js index 09a92cdd..ef2d6211 100644 --- a/test/webpage-spec.js +++ b/test/webpage-spec.js @@ -580,22 +580,6 @@ describe("WebPage object", function() { }); }); - it("should support console.log with multiple arguments", function() { - var message; - runs(function() { - page.onConsoleMessage = function (msg) { - message = msg; - }; - }); - - waits(50); - - runs(function() { - page.evaluate(function () { console.log('answer', 42); }); - expect(message).toEqual("answer 42"); - }); - }); - it("reports unhandled errors", function() { var lastError = null;