mardi 22 décembre 2015

grunt-mocha-test JSON reporter to a file without console.logs

I'm trying to save all the results of the tests in a JSON file using grunt-mocha-test...
I just don't know how to get rid of the console.log outputs, I just need the JSON.
Here is my conf:

 mochaTest: {
158             src: ['app/tests/middleware/**/*.js'],
159             options: {
162                 reporter: 'json',
164                 captureFile: './app/tests/results/mochaResult.json',
165                 //quiet:'true',
166                 require: 'server.js'
167             }
168         },

Here is an output example:

 2 ^[[7m Application loaded using the "test" environment configuration
  3 ^[[0m
  4 connecting to mongodb...
  5 name: localhost
  6 app started on port 3000
  7 successful connection to redis server
  8 {
  9   "stats": {
 10     "suites": 1,
 11     "tests": 5,
 12     "passes": 5,
 13     "pending": 0,
 14     "failures": 0,
 15     "start": "2015-12-23T00:01:43.968Z",

What am I missing? is there an alternative approach to this?

Aucun commentaire:

Enregistrer un commentaire