diff --git a/Gruntfile.js b/Gruntfile.js index 5d67184bb4155def9e7afaa6d4071a25bfbb3649..83f37bc76d5f1360c633d266b3dd3d3dde5c5d97 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -18,7 +18,11 @@ module.exports = function (grunt) { }, jshint: { - all: ['*.js', '!*.min.js'], + all: [ + '*.js', + '!*.min.js', + 'tests/**/*.js' + ], options: { jshintrc: true @@ -48,7 +52,25 @@ module.exports = function (grunt) { } }, - jquery: {} + jquery: {}, + + qunit: { + all: ['tests/index.html'], + options: { + '--web-security': 'no', + coverage: { + src: ['Sortable.js'], + instrumentedFiles: 'temp/', + htmlReport: 'report/coverage/', + coberturaReport: 'report/', + baseUrl: "./coverage", + linesThresholdPct: 99, + functionsThresholdPct: 100, + branchesThresholdPct: 90, + statementsThresholdPct: 90 + } + } + } }); @@ -91,6 +113,7 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-version'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-qunit-istanbul'); grunt.loadNpmTasks('grunt-exec'); // Meteor tasks @@ -98,6 +121,6 @@ module.exports = function (grunt) { grunt.registerTask('meteor-publish', 'exec:meteor-publish'); grunt.registerTask('meteor', ['meteor-test', 'meteor-publish']); - grunt.registerTask('tests', ['jshint']); + grunt.registerTask('tests', ['jshint', 'qunit']); grunt.registerTask('default', ['tests', 'version', 'uglify:dist']); }; diff --git a/tests/index.html b/tests/index.html index 00bfd212f23aaa12d5ad7784cbb21595be4438b5..773c6c9a7f27a22c96789020b886434948131013 100644 --- a/tests/index.html +++ b/tests/index.html @@ -8,32 +8,27 @@