wardbell / bardjs

Spec helpers for testing angular v.1.x apps with Mocha, Jasmine and QUnit
MIT License
178 stars 34 forks source link

Failed to instantiate module function fakeRouteProvider #25

Open realph opened 8 years ago

realph commented 8 years ago

So, I've also watched your unit testing course on Pluralsight and this is basically an identical question to this. I'm getting this error when running my tests:

[$injector:modulerr] Failed to instantiate module function fakeRouteProvider($provide) due to: TypeError: sinon.stub is not a function at new (/Users/realph/../../../node_modules/bardjs/dist/bard.js:389:31)

Sorry for sounding stupid, but maybe I've placed my bard.js files in the wrong place. I'm just running my tests in the console for now with:

karma start karma.conf.js

I've installed bardjs via npm and am including it in my karma.conf.js file like this:

frameworks: ['mocha', 'chai', 'sinon', 'chai-sinon'],

files: [
  ...

  '../../node_modules/sinon/lib/sinon.js',
  '../../node_modules/bardjs/dist/bard.js',

  ...
],

Am I doing something wrong that would be causing this error?

Any help is appreciated. Thanks in advance!