From 83f0793b097f953bcd5b29532eb78a2bf4003137 Mon Sep 17 00:00:00 2001 From: jack yao Date: Sat, 3 Oct 2015 15:52:57 +0800 Subject: [PATCH] add watchfile task and jasmine task,but not tested! --- Gruntfile.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Gruntfile.js b/Gruntfile.js index b4fb15d..fd960fe 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,5 +1,7 @@ //npm install -g grunt-cli //npm install --save-dev grunt-shell +//npm install --save-dev grunt-contrib-watch +//npm install --save-dev grunt-contrib-jasmine //Usage: grunt shell module.exports = function (grunt) { grunt.initConfig({ @@ -9,9 +11,32 @@ module.exports = function (grunt) { command: 'phantomjs system_api.js jacky.yao' } }, + //configure jasmine task + //https://github.com/gruntjs/grunt-contrib-jasmine + jasmine: { + pivotal: { + sec: 'js/src/**/*.js', + optins: { + specs: 'js/spec/*Spec.js' + } + } + }, + // configure file watcher + // https://github.com/gruntjs/grunt-contrib-watch + watch: { + scripts: { + files: [ 'js/src/**/*.js' ], + tasks: [ 'jasmine' ], + options: { + spawon: false, + } + } + } //set up tasks }); grunt.loadNpmTasks('grunt-shell'); + grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-contrib-jasmine'); grunt.registerTask('default',['shell:phantomjs']); };