grunt-simple-mocha icon indicating copy to clipboard operation
grunt-simple-mocha copied to clipboard

Feature request: specify destination for results

Open steveworkman opened this issue 11 years ago • 2 comments

I'm trying to get my mocha tests integrated with Jenkins via the xUnit reporter in mocha. This works fine when using mocha without grunt as I can do this:

mocha -R xunit -r should $WORKSPACE/tests/mocha/*.js > $WORKSPACE/testresults.xml

With grunt, I'd like to do this:

grunt test
// runs simplemocha:production

simplemocha: {
        options: {
            globals: ['should'],
            reporter: 'spec',
            timeout: 5000
        },
        all: { 
            src: [
              // require should...
              'node_modules/should/lib/should.js',
              // This test can use it!
                'tests/mocha/*.js']
        },
      production: {
        options: {
          reporter: 'xunit'
        },
        src: [
          // require should...
          'node_modules/should/lib/should.js',
          // This test can use it!
            'tests/mocha/*.js'],
        dest: 'tests/mocha.xml'
      }
    }

I'm after just the XML output, not the "Running "simplemocha:production" (simplemocha) task" console message before it, otherwise Jenkins won't accept the file as valid xUnit.

steveworkman avatar Apr 18 '13 08:04 steveworkman

Thanks for your work on this plugin! I second @steveworkman's request

jan-molak avatar Jan 13 '14 16:01 jan-molak

I would really like to see the destination option for the XUnit reporter, this makes it much more useful when used with Jenkins.

jjurkiewicz avatar Feb 19 '14 16:02 jjurkiewicz