Fix #1639 logs error in mocha phantom js
Merge pull request #945 from nlegoff/fix1639

[3.9] Fix #1639 logs error in mocha phantom js