Răsfoiți Sursa

gulp-mocha to gulp-spawn-mocha

Sotaro KARASAWA 10 ani în urmă
părinte
comite
037daee112
2 a modificat fișierele cu 7 adăugiri și 7 ștergeri
  1. 5 5
      gulpfile.js
  2. 2 2
      package.json

+ 5 - 5
gulpfile.js

@@ -3,7 +3,7 @@
 var gulp   = require('gulp');
 var sass   = require('gulp-sass');
 var cssmin = require('gulp-cssmin');
-var mocha  = require('gulp-mocha');
+var mocha  = require('gulp-spawn-mocha');
 var concat = require('gulp-concat');
 var rename = require('gulp-rename');
 var uglify = require('gulp-uglify');
@@ -50,8 +50,8 @@ var js = {
   ],
   revealDist: dirs.jsDist + '/crowi-reveal.js',
   clientWatch: ['resource/js/**/*.js'],
-  watch: ['test/**/*.test.js','Gruntfile.js', 'app.js', 'lib/**/*.js'],
-  lint: ['Gruntfile.js', 'app.js', 'lib/**/*.js'],
+  watch: ['test/**/*.test.js', 'app.js', 'lib/**/*.js'],
+  lint: ['app.js', 'lib/**/*.js'],
   tests: tests.watch,
 };
 
@@ -92,9 +92,9 @@ gulp.task('jshint', function() {
 gulp.task('test', function() {
   return gulp.src(js.tests)
     .pipe(mocha({
-      require: [__dirname + '/test/bootstrap.js'], // 絶対pathじゃないとだめとかなにこのplugin
+      r: 'test/bootstrap.js',
       globals: ['chai'],
-      reporter: 'dot',
+      R: 'dot',
     }));
 });
 

+ 2 - 2
package.json

@@ -48,9 +48,9 @@
     "gulp-concat": "^2.5.2",
     "gulp-cssmin": "^0.1.7",
     "gulp-jshint": "~1.10.0",
-    "gulp-mocha": "^2.1.0",
     "gulp-rename": "^1.2.2",
     "gulp-sass": "~2.0.4",
+    "gulp-spawn-mocha": "^2.2.1",
     "gulp-uglify": "~1.2.0",
     "gulp-watch": "~4.2.4",
     "jshint-stylish": "^2.0.0",
@@ -82,7 +82,7 @@
   ],
   "scripts": {
     "start": "node app.js",
-    "test": "mocha --require test/bootstrap.js tests/**/*test.js",
+    "test": "gulp test",
     "postinstall": "bower cache clean && bower install && gulp"
   },
   "env": {