velesin / jasmine-jquery

jQuery matchers and fixture loader for Jasmine framework
MIT License
1.89k stars 346 forks source link

Error during loading: Cannot set property 'spiedEventsKey' of undefined #291

Open spaasis opened 7 years ago

spaasis commented 7 years ago

Hi, I've been fiddling around with the config for a while now, and can't seem to get it to work.

Karma.conf.js:

...
    frameworks: ['jasmine', 'jasmine-jquery'],
    plugins:[ 'karma-jasmine',  'karma-webpack', 'jasmine-jquery'],
    files: [
      {pattern: 'tests/test_index.js', watched: false},
    ]
...

I get two errors when starting the tests:

ERROR [plugin]: Error during loading "jasmine-jquery" plugin:
  Cannot set property 'spiedEventsKey' of undefined

Error: No provider for "framework:jasmine-jquery"! (Resolving: framework:jasmine-jquery)

I've tried setting the jquery and jasmine-jquery paths to the files, changing the order of frameworks and modules, but nothing seems to stick. If I remove jasmine-jquery from frameworks, the second error disappears.

Any clues where to get started?

shadiakiki1986 commented 7 years ago

For the error no provider for framework:jasmine-jquery..., try npm install karma-jasmine-jquery --save-dev, and then replacing jasmine-jquery in the plugins with karma-jasmine-jquery like here

djungowski commented 7 years ago

Not sure if this helps in your case, but I just had the same error message ("Cannot set property 'spiedEventsKey' of undefined"). In my case the reason was, that I accidentally removed the include of Jasmine's boot.js

Other than that: As long as you haven't installed jasmine-jquery via NPM, you will have to load it via the "files" section of the karma config

masoomar commented 4 years ago

I am seeing the same error "Cannot set property 'spiedEventsKey' of undefined". Any update on the fix for this?