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