Comments (5)
Are you using a file URL? Or are your tests running off a Web server?
from jasmine-dom.
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.
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.
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.
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)
- loadFixture doesn't work in Chrome when use file:///... URL. HOT 6
- toBeHidden() and toBeVisible() should check CSS visibility HOT 1
- exception throw when using jasmine-maven-plugin HOT 1
- fixtures: document.body is undefined when using Jasmine 1.2 HOT 2
- Array.prototype.indexOf not supported on IE8
- Using jasmine-dom with Karma
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jasmine-dom.