I'm a little confused. In my little project I'm using Jasmine, Require.js, Phantomjs and Grunt (all these via Yeoman). So when run I grunt test
in the terminal, I get the error:
>> 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.
But when I perform the test in a browser, the test goes fine...
Here's my simple test spec:
define(['spec/test'], function(Test) {
describe('Test for unit-test', function() {
describe('Test namespace', function() {
it('should be defined', function() {
expect(Test).toBeDefined();
});
});
});
});
Module:
define([], function () {
var Test = {};
return Test;
});
Can someone help me solve this, please?
Many thanks
It seems Grunt doesn't load RequireJS. Maybe this could help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With