Conversation
| A test helper `fillInEditor` is exported from `ember-tui-editor/test-support/helpers`, which could be used in integration and acceptance tests: | ||
|
|
||
| ```js | ||
| import { fillInEditor } from 'ember-tui-editor/test-support/helpers'; |
There was a problem hiding this comment.
Wondering if the export path should be maybe simplified to ember-tui-editor/test-support. I guess it would ease discoverability of that test helper.
|
@jelhan perhaps you could improve the example with a real test? I think that is helpful because users will immediately feel "at home" when they see a familiar testing environment. Regarding the import path being
In theory, we could export other things that aren't helpers (maybe setup functions). I also see this pattern used in other addons. |
|
@jelhan friendly reminder of this issue. 😄 |
|
I'm sorry that I haven't come back to this earlier. I had it on my todo list for a long-time. But it always stayed at the bottom.
I'm not entirely how a meaningful example would look like. We expect an user to use the Maybe we could add a link to
Personally I don't see an issue by exporting a setup method and test helpers from the same module. An example for this addon assuming it requires a setup method at some time would look like this: import { setupTuiEditor, fillInEditor } from 'ember-tui-editor/test-support';I think that is easier to read and discover than: import { setupTuiEditor } from 'ember-tui-editor/test-support/setup';
import { fillInEditor } from 'ember-tui-editor/test-support/helpers';Please note that Ember CLI Mirage is also exporting the |
|
@jelhan regarding the example, I meant all the usual boilerplate test code, but I see your point. It becomes harder to see what exactly we are providing with all that code. I'm convinced by your arguments in favor or |
Sure. But I would recommend doing it in a separate PR to keep each of them focused. Should the old export be deprecated? Or would you prefer to keep both long-term? |
|
@jelhan I think deprecating would be ideal. |
Documents the new
fillInEditortest helper as discussed in #477.Please let me know if you see need for additional explanation. The test helper seems to be straight forward to me. But maybe I missed important aspects, which should be documented beside its existence. 😇