cloudchen / grunt-template-jasmine-requirejs

RequireJS template for grunt-contrib-jasmine task
111 stars 97 forks source link

Integrated with jasmine-jquery #87

Open georgezhang opened 8 years ago

georgezhang commented 8 years ago

I am trying to use https://github.com/velesin/jasmine-jquery.git with requirejs. The plugin had been load successfully. But I am unable to load its matchers and getting the error below:

Error: require: undefined is not a constructor (evaluating 'expect(spyEvent).toHaveBeenTriggered()')

My template option is: templateOptions: { requireConfigFile: 'js/config.js', requireConfig: { baseUrl: 'js', paths: { 'jquery': 'http://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.min', 'jasmine-jquery': '../../../../bower_components/jasmine-jquery/lib/jasmine-jquery', }, shim: { 'jasmine-jquery': { deps: ['jquery'], exports: 'jasmine-jquery' } }, },

Any idea? or Any example?

mikeapr4 commented 8 years ago

I recently had a similar issue when I upgraded my grunt-contrib-jasmine version, where the global jasmine variable wasn't being correctly passed to an older version of jasmine-jquery. I upgraded to the latest jasmine-jquery and it solved my problem. Any help?