Function
registerHelper (name, helperMethod, options) public
| Module: | @ember/test |
|---|
Defined in packages/ember-testing/lib/test/helpers.js:8
import { registerHelper } from '@ember/test'; - name
- String
- The name of the helper method to add.
- helperMethod
- Function
- options
- Object
registerHelper is used to register a 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:
import { registerHelper } from '@ember/test';
import { run } from '@ember/runloop';
registerHelper('boot', function(app) {
run(app, app.advanceReadiness);
}); This helper can later be called without arguments because it will be called with app as the first parameter.
import Application from '@ember/application'; App = Application.create(); App.injectTestHelpers(); boot();
© 2020 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
https://api.emberjs.com/ember/3.25/functions/@ember%2Ftest/registerHelper