2014-07-22 51 views
5

我有點困惑。在我的小項目中,我使用了Jasmine,Require.js,Phantomjs和Grunt(所有這些都通過Yeoman)。因此,當在終端上運行我grunt test,我得到的錯誤:ReferenceError:找不到變量:define ...在'with grunt test'在require.js中使用jasmine

>> ReferenceError: Can't find variable: define at 
>> test/spec/testSpec.js:15 

Warning: No specs executed, is there a configuration error? Use --force to continue. 

Aborted due to warnings. 

但是,當我在瀏覽器中進行測試,測試雲罰款...

這裏是我的簡單的測試規範:

define(['spec/test'], function(Test) { 

    describe('Test for unit-test', function() { 
    describe('Test namespace', function() { 
     it('should be defined', function() { 
     expect(Test).toBeDefined(); 
     }); 
    }); 
    }); 

}); 

模塊:

define([], function() { 
    var Test = {}; 

    return Test; 
}); 

有人可以幫我解決這個問題,好嗎?

非常感謝

回答

1

看來Grunt不會加載RequireJS。也許this可以幫助你。

相關問題