Răsfoiți Sursa

add open unit test task

Evan You 11 ani în urmă
părinte
comite
2d6e56b490
2 a modificat fișierele cu 12 adăugiri și 0 ștergeri
  1. 11 0
      build/grunt-tasks/open.js
  2. 1 0
      gruntfile.js

+ 11 - 0
build/grunt-tasks/open.js

@@ -0,0 +1,11 @@
+/**
+ * Open unit tests in real browser.
+ */
+
+module.exports = function (grunt) {
+  grunt.registerTask('open', function () {
+    var path = require('path')
+    var exec = require('child_process').exec
+    exec('open ' + path.resolve(__dirname, '../../test/unit/runner.html'))
+  })
+}

+ 1 - 0
gruntfile.js

@@ -81,6 +81,7 @@ module.exports = function (grunt) {
   require('./build/grunt-tasks/casper')(grunt)
   require('./build/grunt-tasks/codecov')(grunt)
   require('./build/grunt-tasks/release')(grunt)
+  require('./build/grunt-tasks/open')(grunt)
 
   // register composite tasks
   grunt.registerTask('unit', ['karma:browsers'])