nathanboktae / mocha-phantomjs

:coffee: :ghost: Run client-side mocha tests in the command line through phantomjs
MIT License
954 stars 112 forks source link

Update console.log to work with circula reference object #185

Closed nqbao closed 9 years ago

nqbao commented 9 years ago

I found a small bug when mocha-phantomjs reports test as failed while passed in browser. It turns out that i was using console.log to print out a circular object, and mocha-phantomjs console.log function fails to handle that. The bug can be illustrated as follow

var o = {};
o['self'] = o;

console.log(o);

This pull request fixed the bug and also add a unit test to cover that bug.

I hope this will be merged soon!

nathanboktae commented 9 years ago

Nice submission, thanks!