Browse Source

add 'grunt test' task to compile and run tests

Manfred Kroehnert 10 years ago
parent
commit
306cca0ca2
2 changed files with 9 additions and 0 deletions
  1. 8 0
      Gruntfile.js
  2. 1 0
      package.json

+ 8 - 0
Gruntfile.js

@@ -4,8 +4,10 @@ module.exports = function(grunt) {
   grunt.loadNpmTasks('amber-dev');
 
   grunt.loadNpmTasks('grunt-contrib-jshint');
+  grunt.loadNpmTasks('grunt-execute');
 
   grunt.registerTask('default', ['peg', 'amberc:all']);
+  grunt.registerTask('test', ['amberc:test_runner', 'execute:test_runner_run']);
 
   grunt.initConfig({
     pkg: grunt.file.readJSON('package.json'),
@@ -79,6 +81,12 @@ module.exports = function(grunt) {
       }
     },
 
+    execute: {
+      test_runner_run: {
+        src: ['test_runner.js']
+      }
+    },
+
     jshint: {
       amber: ['src/*.js'],
       server: ['server/*.js'],

+ 1 - 0
package.json

@@ -32,6 +32,7 @@
     "pegjs": "~0.8.0",
     "grunt": "~0.4.0",
     "grunt-contrib-jshint": "~0.3.0",
+    "grunt-execute": "~0.2.1",
     "amber-dev": "0.0.3"
   }
 }