Skip to content

Commit

Permalink
Adding karma-grunt so testing is part of build process
Browse files Browse the repository at this point in the history
  • Loading branch information
micjamking committed Feb 22, 2016
1 parent e1aa2dd commit c8d5ba7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Gruntfile.js
Expand Up @@ -43,6 +43,10 @@ module.exports = function(grunt) {
images: {
files: [ '<%= devtools.app %>/images/{,*/}*.png'],
tasks: ['copy:images']
},
jsTest: {
files: ['test/{,*/}*.js'],
tasks: ['newer:jshint:test', 'karma']
}
},

Expand Down Expand Up @@ -103,6 +107,14 @@ module.exports = function(grunt) {
]
},

// Test settings
karma: {
unit: {
configFile: 'karma.conf.js',
singleRun: true
}
},

// Copies remaining files
copy: {
html: {
Expand Down Expand Up @@ -151,6 +163,15 @@ module.exports = function(grunt) {
}
});

grunt.registerTask('test', [
'jshint',
'clean',
'sass',
'autoprefixer',
'copy',
'karma'
]);

grunt.registerTask('serve', [
'clean',
'sass',
Expand All @@ -170,6 +191,7 @@ module.exports = function(grunt) {
]);

grunt.registerTask('package', [
'test',
'default',
'zip'
]);
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -40,6 +40,7 @@
"grunt-contrib-cssmin": "~0.7.0",
"grunt-contrib-jshint": "~0.7.1",
"grunt-contrib-watch": "~0.5.2",
"grunt-karma": "^0.12.1",
"grunt-newer": "~0.6.1",
"grunt-sass": "^1.0.0",
"grunt-wiredep": "^1.9.0",
Expand Down

0 comments on commit c8d5ba7

Please sign in to comment.