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

Can't find variable: Fixture #1

Closed
nikolas opened this issue Jun 27, 2014 · 2 comments
Closed

Can't find variable: Fixture #1

nikolas opened this issue Jun 27, 2014 · 2 comments

Comments

@nikolas
Copy link

nikolas commented Jun 27, 2014

I'm getting this error when putting fixture in my karma frameworks and running the tests.

> ./node_modules/karma/bin/karma start

INFO [karma]: Karma v0.12.16 server started at http://localhost:9876/
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 1.9.7 (Linux)]: Connected on socket yGSejLEmeS9OHiH1hTUP with id 85499202
PhantomJS 1.9.7 (Linux) ERROR
  ReferenceError: Can't find variable: Fixture
  at /home/nik/src/dmt/node_modules/karma-fixture/lib/adapter.js:3
PhantomJS 1.9.7 (Linux): Executed 0 of 0 ERROR (0.055 secs / 0 secs)
@h4xnoodle
Copy link

Same. I'm using require js, as well.

Chrome 35.0.1916 (Mac OS X 10.9.4) ERROR
  Uncaught ReferenceError: Fixture is not defined
  at [...]/node_modules/karma-fixture/lib/adapter.js:3

@billtrik
Copy link
Owner

@nikolas @h4xnoodle Are you still getting this error?

This is due to the fact that you probably declared requirejs inside the frameworks array after fixture.
This leads to require getting loaded before fixture, so fixture gets defined() via require.js and not registered on global scope.
I could modify adapter.js to try to require() it via require.js as well, but i think i should not.

I personally place requirejs in the beginning of this array, so that all of the other frameworks get to register on global scope (as they were meant?) before require.js starts to register stuff for its own.

If you think otherwise, let me know.

@billtrik billtrik closed this as completed Mar 6, 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