Skip to content

Commit

Permalink
TST/BUG: Remove error messages from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ElDeveloper committed Oct 27, 2016
1 parent 5362489 commit d5bda44
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions tests/javascript_tests/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@
result = message.data;
failed = !result || result.failed;

phantom.exit(failed ? 1 : 0);
exit(failed ? 1 : 0);
}
}
};

page.open(url, function(status) {
if (status !== 'success') {
console.error('Unable to access network: ' + status);
phantom.exit(1);
exit(1);
} else {
// Cannot do this verification with the 'DOMContentLoaded' handler because it
// will be too late to attach it if a page does not have any script tags.
Expand Down Expand Up @@ -136,4 +136,21 @@
});
}, false);
}

/*
This function was taken from:
https://github.com/jonkemp/qunit-phantomjs-runner
It helps prevent some problems with the output produced by this script.
*/
function exit(code) {
if (page) {
page.close();
}
setTimeout(function () {
phantom.exit(code);
}, 0);
}


})();

0 comments on commit d5bda44

Please sign in to comment.