Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Commit

Permalink
Port the test for console.log multiple arguments.
Browse files Browse the repository at this point in the history
  • Loading branch information
ariya committed Sep 30, 2014
1 parent 7e8986c commit a5f0ff7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions test/run-tests.py
Expand Up @@ -26,6 +26,7 @@
'module/system/*.js',
'module/webpage/*.js',
'standards/javascript/*.js',
'standards/console/*.js',
'regression/*.js',
'run-tests.js'
]
Expand Down
16 changes: 16 additions & 0 deletions 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');
16 changes: 0 additions & 16 deletions test/webpage-spec.js
Expand Up @@ -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;

Expand Down

0 comments on commit a5f0ff7

Please sign in to comment.