question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to run Jasmine tests with fixtures

See original GitHub issue

Hi,

I’m attempting to use jasmine-rails to process coffeescript (both code & tests), but I keep seeing “ReferenceError: Can’t find variable: Regions in […]/tmp/jasmine/assets/jasmine-specs.js (line 10723)”. I check the compiled jasmine-specs.js file and I see Regions defined before line 10723. Can you offer any suggestions on how to get these tests running? Also, let me know if you need to see anything else. Thanks.

Relevant gems in use:

  • jasmine (1.3.2)
  • jasmine-core (1.3.1)
  • jasmine-rails (0.7.1)

Includes:

  • jasmine-jquery.js

Failing test (settings_spec.js.coffee):

describe 'Settings', ->
  beforeEach ->
    loadFixtures('settings.html')
    Regions.setup()
    Modal.setup()
    return

  it 'should disable all locations dropdowns except APAC on page load', ->
    expect($("#locations_apac")).toBeHidden()
    expect($("#locations_emea")).toBeVisible()

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
nathanycommented, Jul 10, 2014

It turns out that --web-security=no was unnecessary.

I added this to spec_helper.js.coffee:

# rake spec:javascript loads specs relative to the tmp/jasmine/runner.html, need to override:
jasmine.getFixtures().fixturesPath="../../spec/javascripts/fixtures"
0reactions
searlscommented, Oct 26, 2017

(Maybe) fixed by #216

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jasmine : Fixture could not be loaded - Stack Overflow
So i wanted to get into Test Driven Development and decided to use Jasmine on my project. The thing is, i can't load...
Read more >
Sample Project On Front-End Unit Testing Using KARMA And ...
This tutorial shows how to write test specs for a sample project using Karma & Jasmine. You will also learn how to use...
Read more >
Component testing scenarios - Angular
The first is a sanity test; it confirms that the stubbed UserService is called and working. The second parameter to the Jasmine matcher...
Read more >
[Solved]-Fixtures won't load in Karma-grunt.js
set the path using base/ such as jasmine.getFixtures().fixturesPath = 'base/test/fixtures'; in your test suites. load the fixtures into your test ...
Read more >
jasmine an error was thrown in afterall - You.com
Intermittently we are seeing different unit tests fail on production configuration test runs. WallabyJS does not fail (it doesn't run production ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found