2013-08-30 11 views
6

Bir test başarısız olduğunda yığın izlemesi görmem gerekir, ancak Grunt Mocha test paketini çalıştırdığında bir şey gizleniyor. Bu Gruntfile ileGrunt görevinden Mocha çalıştırılırken yığın izleme gizlenir

site/server/server.js:10 
    server.use(express.static(path.join(__dirname('../client')))); 
             ^
TypeError: string is not a function 
    at ... 

Ama:

$ grunt test 
Running "cafemocha:test" (cafemocha) task 
Warning: string is not a function Use --force to continue. 

Aborted due to warnings. 
:

'use strict'; 

var should = require('should'); 

module.exports = function(grunt) { 
    grunt.initConfig({ 
     cafemocha: { 
      test: { 
       src: 'server/test/**/test-*.js', 
       options: {/* 
        ui: 'bdd', 
        growl: true, 
        coverage: true, 
        reporter: 'spec' 
       */} 
      } 
     }, 

     watch: { 
      files: [ 
       'server/**/*.js', 
       'Gruntfile.js', 
       'package.json' 
      ], 
      tasks: [ 'test' ] 
     }, 

     complexity: { 
      generic: { 
       src: [ 
        'server/**/*.js', 
        'Gruntfile.js' 
       ], 
       options: { 
        cyclomatic: 2, 
        halstead: 9, 
        maintainability: 80 
       } 
      } 
     } 
    }); 

    grunt.loadNpmTasks('grunt-notify'); 
    grunt.loadNpmTasks('grunt-contrib-watch'); 
    grunt.loadNpmTasks('grunt-cafe-mocha'); 
    grunt.loadNpmTasks('grunt-complexity'); 

    grunt.registerTask('default', [ 'cafemocha' ]); 
    grunt.registerTask('test', [ 'cafemocha', 'complexity' ]); 
}; 

ı get bir hata bir özetidir Testleri çalıştırdığınızda kendim (mocha --recursive) Bir yığın izleme olsun

cevap

12

Yığın izleri varsayılan olarak grunt'ta gizlenir. Göstermek için grunt --stack ile koşarak koşun.

İlgili konular