Closed mhoyer closed 9 years ago
Sorry for not responding to you originally, but I couldn't reproduce this with mocha-phantomjs
v4. Either way it's highly likely an issue with phantomjs anyways, but if you're still having issues, let me know. Perhaps it was a specific phantomjs version?
I actually tried to play around with gulp-mocha-phantomjs and got stuck for some hours to actually find the reason why it was not working in my scenario.
Therefore I stepped down into dependent npm modules and tried to figure out which component is in charge for my errors and it seems to be an issue in lib/mocha-phantomjs.coffee. Thus, I could reproduce the issue also with just using
mocha-phantomjs
.The problem
I (actually the gulp-mocha-phantomjs package) tried to run this command on my Windows box:
c:\Temp\node_modules\phantomjs\lib\phantom\phantomjs.exe c:\Temp\node_modules\mocha-phantomjs\lib\mocha-phantomjs.coffee c:/Temp/index.html spec
Without absolute paths this might look like
phantomjs.exe lib\mocha-phantomjs.coffee c:/Temp/index.html
The error was
Failed to start mocha: Init timeout
after some seconds.Now the funny thing is, this error occurs only in the following scenario:
URL
argument for themocha-phantomjs.coffee
contains an absolute pathReproduction
For simplification I created this sample:
Save this file into
c:\Temp\index.html
:Now run this:
^^ play around with saving the
index.html
with plain UTF8 encoding and UTF8+BOM encoding.