registerAsyncHelper (name, helperMethod) public
registerAsyncHelper
is used to register an async test helper that will be injected when App.injectTestHelpers
is called.
The helper method will always be called with the current Application as the first parameter.
For example:
Ember.Test.registerAsyncHelper('boot', function(app) { Ember.run(app, app.advanceReadiness); });
The advantage of an async helper is that it will not run until the last async helper has completed. All async helpers after it will wait for it complete before running.
For example:
Ember.Test.registerAsyncHelper('deletePost', function(app, postId) { click('.delete-' + postId); }); // ... in your test visit('/post/2'); deletePost(2); visit('/post/3'); deletePost(3);
Parameters:
-
name
String
- The name of the helper method to add.
-
helperMethod
Function
Please login to continue.