Skip to content

Commit

Permalink
Add missing err argument to getPathname callbacks.
Browse files Browse the repository at this point in the history
The callback for `page.evaluate` should expect an error argument
followed by the result. Our callbacks were expecting the result only.

This means our assertions were checking that null === null instead of
checking if pathnames matched. Both assertions pass, but the latter
is more useful for finding bugs. :)
  • Loading branch information
reid committed Feb 6, 2014
1 parent 5a632a9 commit ead8aaf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/functional/functional.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function captureContext(batchContext) {

lastTopic.client.once("agentConnect", function (agent) {
lastTopic.client.once("agentSeen", function () {
page.evaluate(getPathname, function (url) {
page.evaluate(getPathname, function (err, url) {
clearTimeout(timeout);
loaded = true;
vow.callback(null, {
Expand Down Expand Up @@ -218,7 +218,7 @@ function createBatchTopic(createBatchConfiguration) {
batch.on("complete", function () {
lastTopic.client.once("agentSeen", function (agent) {
clearTimeout(timeout);
pageTopic.page.evaluate(getPathname, function (pathname) {
pageTopic.page.evaluate(getPathname, function (err, pathname) {
pageTopic.page.close();
vow.callback(null, {
expectedPathname: pageTopic.url,
Expand Down

0 comments on commit ead8aaf

Please sign in to comment.