Skip to content

Instantly share code, notes, and snippets.

@peterssonjesper
Created August 15, 2013 18:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterssonjesper/6243298 to your computer and use it in GitHub Desktop.
Save peterssonjesper/6243298 to your computer and use it in GitHub Desktop.
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
// Task configuration.
jasmine: {
all: {
src: [
'public/javascripts/src/**/*.js',
],
options: {
'vendor': 'public/javascripts/libs/**/*.js',
'specs': 'public/javascripts/spec/**/*.js'
}
},
istanbul: {
src: '<%= jasmine.all.src %>',
options: {
vendor: '<%= jasmine.all.options.vendor %>',
specs: '<%= jasmine.all.options.specs %>',
template: require('grunt-template-jasmine-istanbul'),
templateOptions: {
coverage: 'coverage/json/coverage.json',
report: [
{type: 'html', options: {dir: 'coverage/html'}},
{type: 'text-summary'}
]
}
}
}
},
watch: {
js: {
files: [
'public/javascripts/src/**/*.js',
'public/javascripts/spec/**/*.js'
],
tasks: ['jasmine:all']
}
}
});
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('test', ['jasmine:all']);
grunt.registerTask('coverage', ['jasmine:istanbul']);
grunt.registerTask('default', ['watch']);
};
@james-wang-atx
Copy link

awesome!

@geekSivz
Copy link

geekSivz commented Mar 9, 2015

how to mention these files are not to test... Suggest some idea.

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