Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4870

Is there an alternative to using `Ember.testing`?

$
0
0

Every time I need to do import Ember from 'ember' to be able to use Ember.testing in a conditional, I cringe a bit.

In an ecosystem on the fast track to Embroider, it seems a huge opportunity cost to have to import the whole Ember module as Embroider will then need to pull in everything so we can’t tree shake the unused modules.

However, for multiple scenarios, I think we still need Ember.testing. The ones I can think of (have seen) are:

  1. Setting different timeouts in tests

You don’t want to show a toast message for 2 seconds in your tests but you do in other environments.

  1. You want to be able to stub out certain 3rd party libraries in testing

The example I have at hand is having fake credit card fields (stubbing out an external js library provided by Stripe) in testing.

  1. Not integrating some providers while testing

Intercom/Zendesk/etc. is one example, I’m sure there are others.

Am I wrong in supposing that we still need Ember.testing, or that using it will prevent us from shedding unused JS modules with Embroider?

Thank you, Balint

8 posts - 4 participants

Read full topic


Viewing all articles
Browse latest Browse all 4870

Trending Articles