Ember component testing DRYing up needs


I’ve been digging into testing, and the brunt of the work is occurring in component tests.

One thing that has gotten a bit crazy for me is the needs array. As I compose more and more components together then the needs keeps getting longer and longer and they all repeat themselves. I also have some initialization code that has to happen for different components, in my case using ember-modal-dialog I need to create a container for it to wormhole into in a beforeEach.

At the moment I’m just copy pasting the same needs and beforeEach all over the place but this just seems wrong.

How are other people handling this?