I am trying to integrate my test into bamboo. With bamboo, it seems like I need test results in junit xml format. Because of this, I need to execute the "grunt jasmine" execution to output the test results in xml format. I am new to jasmine / grunt / junit and have spent more time than I would like to admit trying to get this to work. I followed various tutorials and tips (mostly https://gist.github.com/asabaylus/3059886 ), but I was just stuck.
When I run "grunt jasmine" from gitbash, the specifications run successfully, but the output file is not generated, and I get the following error ... "Error while processing the template (cannot call the indexO method f 'of undefined). Use -force to continue.
Interrupted due to warnings.
Do I need to change any other files? Can someone help me work this out?
Please thanks! CC
Grunt.js file
/*global module:false*/ module.exports = function ( grunt ) { // Project configuration. grunt.initConfig({ meta: { banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' + '<%= grunt.template.today("yyyy-mm-dd") %>\n' + '<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' + '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' + ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */' }, lint: { files: ['grunt.js', 'src/**/*.js'] }, jasmine: { all: ['./SpecRunner.html'], junit: { dest: 'test-results' } }, concat: { dist: { src : ['<banner:meta.banner>', '<file_strip_banner:src/buyitnow.js>'], dest: 'dist/buyitnow/<%= meta.version %>/buyitnow.js' } }, min: { dist: { src : ['<banner:meta.banner>', '<config:concat.dist.dest>'], dest: 'dist/buyitnow/<%= meta.version %>/buyitnow.min.js' } }, watch: { files: '<config:lint.files>', tasks: 'lint' }, jshint: { options: { curly : true, eqeqeq : true, immed : true, latedef: true, newcap : true, noarg : true, sub : true, undef : true, boss : true, eqnull : true, browser: true, jquery : true, node : true }, globals: {} }, uglify: {} }); grunt.loadNpmTasks('grunt-jasmine-task'); // Default task. grunt.registerTask('default', 'lint jasmine concat min cssmin');};
My specrunner.html file
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Jasmine Spec Runner</title> <link rel="shortcut icon" type="image/png" href="lib/jasmine-1.3.1/jasmine_favicon.png"> <link rel="stylesheet" type="text/css" href="lib/jasmine-1.3.1/jasmine.css"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script type="text/javascript" src="lib/jasmine-1.3.1/jasmine.js"></script> <script type="text/javascript" src="lib/jasmine-1.3.1/jasmine-html.js"></script> <script type="text/javascript" src="lib/jasmine.async.min.js"></script> <script type="text/javascript" src="lib/sinon-1.6.0.js"></script> <script type="text/javascript" src="node_modules/jasmine-reporters/src/jasmine.junit_reporter.js"></script> <script type="text/javascript" src="spec/binSpec.js"></script> <script type="text/javascript"> (function() { var jasmineEnv = jasmine.getEnv(); jasmineEnv.updateInterval = 1000; var htmlReporter = new jasmine.HtmlReporter(); jasmineEnv.addReporter(htmlReporter); </script> </head> <body> </body> </html>