From 1f850329b4a6c9bfd14b618a9d76ef802eea28ca Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Mon, 29 Sep 2014 01:21:08 +1000 Subject: Lots of changes: now async, behaviour almost entirely managed by plugins --- Gruntfile.js | 47 ++++++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 19 deletions(-) (limited to 'Gruntfile.js') diff --git a/Gruntfile.js b/Gruntfile.js index c09bdde..e2febff 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -27,25 +27,33 @@ module.exports = function (grunt) { }, watch: { options: { - livereload: true + spawn: false, + dateFormat: function(time){} }, - files: [ - 'Gruntfile.js', - 'injector.js', - 'injector-tests.js' - ], - tasks: ['default', 'karma:unit:run'] + test: { + files: [ + "injector.js", + "injector-tests.js" + ], + tasks: ['test'] + } }, - karma: { - options: { - configFile: "karma.conf.js" - }, - unit: { - background: true - }, - once: { - singleRun: true, - reporters: ['dots'] + mochaTest: { + test: { + options: { + clearRequireCache: true, + reporter: 'min', + require: [ + function(){ + Injector = require('./injector'); + expect = require('chai').expect; + } + ] + }, + src: [ + "injector.js", + "injector-tests.js" + ] } } }); @@ -53,9 +61,10 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-watch'); - grunt.loadNpmTasks('grunt-karma'); + grunt.loadNpmTasks('grunt-mocha-test'); grunt.registerTask('default', ['jshint', 'uglify']); - grunt.registerTask('live', ['default', 'karma:unit:start', 'karma:unit:run', 'watch']); + grunt.registerTask('test', ['jshint', 'mochaTest']); + grunt.registerTask('live', ['test', 'watch:test']); }; -- cgit v1.2.3