2014-04-23 40 views
2

由於某些原因,當我從Grunt運行它時,Jasmine中的異步函數(等待,等待,運行)不可用。在Grunt上運行的Jasmine找不到異步函數

在咕嚕:

jasmine:{ 
    pivotal:{ 
     src: 'src/**/*.js', 
     options:{ 
      specs: 'spec/**/*.spec.js' 
     } 
    } 
} 

在茉莉花規格:

describe('jasmine', function(){ 
    it("should find 'waits'", function(){ 
     waits(1000); 
    }); 
    it("should find 'waitsFor'", function(){ 
     waitsFor(function(){}, 1000); 
    }); 
    it("should find 'runs'", function(){ 
     runs(function(){}); 
    }); 
}) 

茉莉花輸出:

jasmine 
    × should find 'waits' 
    ReferenceError: Can't find variable: waits in file:///G:/Projects/myproj/spec/test.spec.js (line 3) (1) 
    × should find 'waitsFor' 
    ReferenceError: Can't find variable: waitsFor in file:///G:/Projects/myproj/spec/test.spec.js (line 6) (1) 
    × should find 'runs' 
    ReferenceError: Can't find variable: runs in file:///G:/Projects/myproj/spec/test.spec.js (line 9) (1) 

我缺少的東西?

回答

相關問題