Browse Source

organize grunt tasks

Evan You 12 years ago
parent
commit
72e8e73b2e
2 changed files with 16 additions and 7 deletions
  1. 14 5
      Gruntfile.js
  2. 2 2
      test/functional/specs/expression.js

+ 14 - 5
Gruntfile.js

@@ -17,7 +17,7 @@ module.exports = function( grunt ) {
                 src: '.',
                 dest: 'dist'
             },
-            test: {
+            unit: {
                 options: {
                     name: 'vue.test'
                 },
@@ -87,18 +87,27 @@ module.exports = function( grunt ) {
     })
 
     grunt.registerTask( 'build', [
-        'componentbuild',
+        'componentbuild:build',
         'uglify',
         'size'
     ])
 
-    grunt.registerTask( 'test', [
-        'componentbuild',
+    grunt.registerTask( 'unit', [
+        'componentbuild:unit',
         'jsc',
-        'mocha',
+        'mocha'
+    ])
+
+    grunt.registerTask( 'e2e', [
+        'componentbuild:build',
         'casper'
     ])
 
+    grunt.registerTask( 'test', [
+        'unit',
+        'e2e'
+    ])
+
     grunt.registerTask( 'default', [
         'jshint',
         'test',

+ 2 - 2
test/functional/specs/expression.js

@@ -18,7 +18,7 @@ casper.test.begin('Expression', 19, function (test) {
     })
     .then(function () {
         test.assertSelectorHasText('#normal p', 'Hola World!')
-        test.assertField('one', 'Hola')  
+        test.assertField('one', 'Hola')
     })
     .thenEvaluate(function () {
         // setting nested value
@@ -26,7 +26,7 @@ casper.test.begin('Expression', 19, function (test) {
     })
     .then(function () {
         test.assertSelectorHasText('#normal p', 'Hola Casper!')
-        test.assertField('two', 'Casper')  
+        test.assertField('two', 'Casper')
     })
     .then(function () {
         // lazy input