Javascript 引用错误:Can';找不到变量:定义在。。。与';咕噜试验';在require.js中使用jasmine

Javascript 引用错误:Can';找不到变量:定义在。。。与';咕噜试验';在require.js中使用jasmine,javascript,requirejs,gruntjs,jasmine,phantomjs,Javascript,Requirejs,Gruntjs,Jasmine,Phantomjs,我有点困惑。在我的小项目中,我使用Jasmine、Require.js、Phantomjs和Grunt(所有这些都是通过Yeoman实现的)。因此,当在终端中运行Igrunt test时,我得到错误: >> ReferenceError: Can't find variable: define at >> test/spec/testSpec.js:15 Warning: No specs executed, is there a configuration erro

我有点困惑。在我的小项目中,我使用Jasmine、Require.js、Phantomjs和Grunt(所有这些都是通过Yeoman实现的)。因此,当在终端中运行I
grunt test
时,我得到错误:

>> 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;
});
有人能帮我解决这个问题吗


非常感谢

Grunt似乎没有加载RequireJS。也许我能帮你