Ember CLI Test Assistants

Can someone point me to a resource on how to implement a test helper with ember-cli?

Or just a simple explanation?

I know that helpers are in the test / helpers directory, but how do you load them into integration tests?

thanks

+5
source share
1 answer

The only way I found this is:

// tests/helpers/controller.js import Ember from 'ember'; Ember.Test.registerHelper('controller', function (app, name) { return app.__container__.lookup('controller:' + name); }); 

then in my acceptance test:

 // acceptance/index-test.js import Ember from 'ember'; // import our helper (this might be done within helpers/start-app.js to always import all helpers) import '../helpers/controller'; import startApp from '../helpers/start-app'; // your tests using the helper(s) 

But there may be a better way to do it.

+5
source

Source: https://habr.com/ru/post/1202185/


All Articles