wardbell / bardjs

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

bard is not defined Karma #9

Closed AquilaSagitta closed 9 years ago

AquilaSagitta commented 9 years ago

I installed bard via npm.

This is my karma.conf.js files

files: [
      'node_modules/bardjs/dist/bard.js',
      ...
]

running tests get Uncaught ReferenceError: bard is not defined

What am I doing wrong?

wardbell commented 9 years ago

Not enough to go on here. Need to see more of the error flow

I'm suspecting an error when bard loads. If bard can't load, the bard object will not be defined.

One common cause is neglecting to load sinon.js first. Bard depends on sinon.

What does your frameworks array look like? The following has been shown to work.

// frameworks to use
// some available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['mocha', 'chai', 'sinon', 'chai-sinon'],

'chai-sinon` may be unfamiliar to you. Check it out here.

You might try creating an index.html, listing in order all of the files that you think karma should load. It might be easier to discover what's going wrong that way.

johnpapa commented 9 years ago

closing due to inactivity