Giter Site home page Giter Site logo

Comments (5)

jeffwatkins avatar jeffwatkins commented on July 29, 2024

Are you using a file URL? Or are your tests running off a Web server?

from jasmine-dom.

levous avatar levous commented on July 29, 2024

I'm using the jasmine gem in a non rails, static file environment
When I use the jasmine-jquery loadFixtures, it loads prior to the tests being executed

(but I'd rather use yours as I don't want to introduce query into my tests)
:)

from jasmine-dom.

jeffwatkins avatar jeffwatkins commented on July 29, 2024

The code actually uses the following:

_loadFixtureIntoCache: function(url)
  {
    var self= this;
    var xhr= new jasmine.Fixtures.XHR();
    xhr.open('GET', url, false);
    xhr.send(null);
    var status= xhr.status;
    var succeeded= 0===status || (status>=200 && status<300) || 304==status;

    if (!succeeded)
      throw new Error('Failed to load resource: status=' + status + ' url=' + url);
    this._fixturesCache[url]= xhr.responseText;
  },

You've changed the async parameter from false to true. There is no way for the method to block until the XHR request is complete in async mode.

from jasmine-dom.

levous avatar levous commented on July 29, 2024

You wrote:

You've changed the async parameter from false to true. There is no way for the method to block until the XHR request is complete in async mode.

But I did not change the code at all. I simply wrote the spec and found the code that was running first. I am not sure why I had this version of code. I'll try the latest and see if that works correctly. Thanks very much for the response.

from jasmine-dom.

jeffwatkins avatar jeffwatkins commented on July 29, 2024

Actually, it turns out I'm a complete idiot: in an early version I had the flag backwards (making the call async instead of sync). You probably just need to pull to get the latest version.

Sorry about that.

from jasmine-dom.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.