Last active
May 18, 2018 10:56
-
-
Save timjacobi/f68f0ea088a44b2e6b8669bd1e71ab73 to your computer and use it in GitHub Desktop.
Promise Kata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Implementation | |
class Promise {} | |
// Test Code | |
const adapter = { | |
deferred() { | |
const pending = {}; | |
pending.promise = new Promise((resolver, reject) => { | |
pending.resolve = resolver; | |
pending.reject = reject; | |
}); | |
return pending; | |
}, | |
resolved: val => Promise.resolve(val), | |
rejected: val => Promise.reject(val) | |
}; | |
require("promises-aplus-tests")(adapter, { reporter: "dot" }, console.error.bind(console)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment