I have a mocha test which I want to run inside gradle task.
When I run it standalone I get a nice output like this:

But when I run it through gradle I get output like this:
I managed to display characters correctly although without colors. What is bothering me is that the output is not complete. Also output lenght is different each time I run the task. This makes me believe that this happens because test script is ran asynchronously inside node.js
Is there a way to fix this in gradle?