Closed clmath closed 9 years ago
I am not sure how to test this plugin as the returned value will vary according to the tested platform.
But, the returned value always has the same API, right? It's not your job to test that the Promise shim (or the native implementation) work correctly, but you could have a simple smoke test unit test like:
promiseAssertWorks: function () {
var d = this.async(1000);
new Promise(function (resolve) {
setTimeout(resolve, 50);
}).then(function () {
d.resolve(true);
});
},
The code for the plugin itself looks fine to me.
I added the unit test and change the local require to the global require.
Merged in 89e7655a964b0f54e5c75b8cbe4ef4c2339a8e58
I am not sure how to test this plugin as the returned value will vary according to the tested platform.