2017
Ember Tips: Testing Outgoing HTTP Requests
Ember.js is a web frontend framework and it’s no surprise that majority of the applications deal with a lot of HTTP requests. But such fact has a lot of implications on the process of development of the Ember apps, especially when it comes to testing. For basic GET
requests which don’t include any query params or don’t deal with pagination it’s quite straight-forward - for those we just want to fetch some data, so we can check if proper objects are present as a side-effect of these requests. What about POST
, PATCH
or DELETE
requests, where we can’t easily test the side effects?
Ember Tips: Managing Timeouts And Delays
Timeouts and delays are quite extensively used in many applications when deferring execution of some action via Ember.run.later
or debouncing via Ember.run.debounce
. Having small amounts of tests executing such methods might not be a problem initially, but obviously, as the application grows, this can easily lead to slow test suite which takes minutes to finish due to the waiting for all the timeouts and delays in many places. Let’s try to find the best solution to solve this problem.
2016
Ember Tips: Computed Properties And Arrow Functions? Not A Good Idea
Arrow function expressions were definitely a great addition in ES6 and thanks to tools like babel the new syntax has been quite widely adopted. Besides more concise syntax, an interesting thing about arrow function expressions is that they preserve the context, i.e. they don't define their own this
, which was sometimes annoying and resulted in assigning that
or self
variables to keep the outer context that could be referred inside functions. As great as it sounds, arrow function expressions cannot be used in all cases. One example would be Ember computed properties.