0

I've some test helpers in my addon. I want to:

  1. use these helpers for my addon's own tests.
  2. make these helpers available to my addon's users, for testing their own codes.

In the documentation, it is said that test-support can be used to satisfy the second requirement mentioned above; but I couldn't find a way to make it work for both.

ykaragol
  • 6,139
  • 3
  • 29
  • 56
  • 1
    Note that the docs say "_merged with the application’s tests/_", So the helpers you would like to share should be going into `test-support/helpers/`. It is hard to imagine what could be wrong going solely by the information you've given. You could take a look at an open source addon which also shares a helper, (like [emberx-select](https://github.com/thefrontside/emberx-select) shares their `select` helper) – Lars Aug 12 '16 at 18:07
  • I'll verify it on monday, but I think you are correct. So can you copy your comment as answer? So I can accept the solution. – ykaragol Aug 14 '16 at 11:44

1 Answers1

2

The docs say "merged with the application’s tests/",

An applications test-helpers reside in test/helpers/, any helper specified here should be registered automatically.

When sharing an addons test-helper, make sure it resides in test-support/helpers,

Once the directory get merged, the file should end up in the tests/helpers directory and be registered automatically.

As a reference one could take a look at the emberx-select addon, A "select"-helper is shared using the same method specified in this answer.

Lars
  • 3,022
  • 1
  • 16
  • 28