Skip to content

Instantly share code, notes, and snippets.

@dylants
Created July 18, 2013 19:28
Show Gist options
  • Save dylants/6032247 to your computer and use it in GitHub Desktop.
Save dylants/6032247 to your computer and use it in GitHub Desktop.
Gruntfile for mocha/jenkins integration
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks("grunt-mocha-test");
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: ["test-reports.xml"],
mochaTest: {
"test": {
options: {
reporter: "xunit"
},
src: ["test/**/*.js"],
dest: "test-reports.xml"
}
}
});
grunt.registerTask("default", ["clean", "mochaTest"]);
};
@yamsellem
Copy link

Using grunt-mocha-test 0.8.2, the configuration changed to this:

mochaTest: {
    jenkins: {
        src: ['tests/**/*.js'],
        options: {
            reporter: 'xunit',
            quiet: true,
            captureFile: 'test-reports.xml'
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment