wardbell / bardjs

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

Sinon undefined when using Jasmine #6

Closed Rleahy22 closed 9 years ago

Rleahy22 commented 9 years ago

With setup:

bard.inject('$controller', '$q', '$rootScope', 'serviceName');

When calling

bard.mockService(serviceName, {
    method: $q.when({})
});

in my tests I get an error:

'undefined' is not an object (evaluating 'service[key] = sinon.spy(function() {
    return value;
})')

at /{myApp}/bower_components/bardjs/dist/bard.js:561

my bower file incldues:

"devDependencies": {
    "angular-mocks": "~1.4.0",
    "bardjs": "~0.1.3",
    "sinon": "~1.14.1"
}

and all bower_components are included in my karma.conf.js file

Rleahy22 commented 9 years ago

never mind, figured it out