I couldn't get my casperjs asserts colored on my cmd.exe (Windows 7, x64). I followed ansicon.
If I understood right, asserts are colored automatically if ansicon is installed casperjs
Windows users will get colorized output if ansicon is installed.
Any ideas?
UPDATE
var casper = require('casper').create(),
utils = require('utils'),
http = require('http'),
fs = require('fs'),
colorizer = require('colorizer').create('Colorizer');
var xpath = require('casper').selectXPath;
casper.start('http://google.com/').then(function(response) {
casper.echo('This is supposed to be green', 'INFO');
});
casper.run();
CMD:
C:\Users\itsme\Desktop>casperjs test test.js
Test file: test.js
This is supposed to be green
C:\Users\itsme\Desktop>casperjs test test.js
The answer is over here: ANSI-Coloring Console Output with .NET
The CasperJS binary package comes with a pre-compiled casperjs.exe
that targets the x86 platform. Unfortunately, that has the effect you mention on x64 versions of ansicon.
Solutions:
ansicon.exe
Recompile casperjs.exe
for the x64 platform, which is quick and painless:
C:\>cd casperjs\src
C:\casperjs\src>C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /platform:x64 casperjs.cs
Copy the resulting .exe to the bin
directory and you're done.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With