Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bard is not defined Karma #9

Closed
AquilaSagitta opened this issue Jun 24, 2015 · 2 comments
Closed

bard is not defined Karma #9

AquilaSagitta opened this issue Jun 24, 2015 · 2 comments

Comments

@AquilaSagitta
Copy link

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
Copy link
Owner

wardbell commented Jul 1, 2015

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
Copy link
Collaborator

johnpapa commented Aug 8, 2015

closing due to inactivity

@johnpapa johnpapa closed this as completed Aug 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants