inertia
inertia

Reputation: 404

Ember data lazy loading

I am writing qunit tests for an ember controller. In my real application I get routed from another page and get data. But, while writing tests I am having trouble getting the data from Ember data store as it sends an asynchronous call and tests run and fail till it gets the data. Any way to force ember store to return the data in the same run loop? Or is there any other way to do it?

Upvotes: 1

Views: 778

Answers (1)

sly7_7
sly7_7

Reputation: 12011

Do you use the FixtureAdapter ? If not, you can try it, and set its simulateRemoteResponse property to false. Your store in tests could be like

var store = DS.Store.create({
               revision: 4,
               adapter: DS.FixtureAdapter.create({simulateRemoteResponse: false}),
               // perhaps other custom properties
            });

Upvotes: 2

Related Questions