Use es6 Promise 

All test passes except jquery integration.
Somehow the $.when did not wait for promise to resolve and return the value.
Any idea why? I am not too familiar with jquery promise.