Testing
See original GitHub issueHey dude! First of all, this addon is great - I’m really liking the pretty default styles out of the box.
One question I have though: in acceptance tests, Ember waits for the run loop to clear before continuing. I notice that when I write an acceptance test for notifications, I have to wait clearDuration
amount of time before my test continues. This slows down the test and is a little annoying.
It seems like these two methods are causing that to happen. So my resolution was to allow those methods to run, only if Ember isn’t in test mode. (Using the Ember.testing
flag would also work, instead of a having to manually toggle a variable on the service.)
Do you think it’s a good idea to incorporate this change into ember-cli-notifications? Alternatively, I can simply extend the notifications service (as part of this recent change), and make the method overrides myself.
I’d love to hear what you think!
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:11 (1 by maintainers)
Top GitHub Comments
Did you tried out to set
clearDuration
to 1ms in testing environment? I’m using this approach and didn’t faced any issues with it so far.Even with
setDefaultClearDuration
at 0, the close animation slows down acceptance tests. I guess this is becauseremoveNotification
has a hard-coded 500ms delay? https://github.com/stonecircle/ember-cli-notifications/blob/master/addon/services/notification-messages-service.js#L72