Commit 62f65d75 62f65d750140cef9c9d3923090808826e60e4c56 by Nicolas Perriault

smarter Casper.echo()

1 parent 7db58eff
Subproject commit de794d9573bb5b23da162129482b2d8a9acfbddc
Subproject commit fa26816f9ddc9f40de50c6b478b7a57265293806
......
......@@ -497,6 +497,17 @@ Casper.prototype.each = function each(array, fn) {
*/
Casper.prototype.echo = function echo(text, style, pad) {
"use strict";
if (!utils.isString(text)) {
try {
text = text.toString();
} catch (e) {
try {
text = utils.serialize(text);
} catch (e) {
text = '';
}
}
}
var message = style ? this.colorizer.colorize(text, style, pad) : text;
console.log(this.filter('echo.message', message) || message);
return this;
......