Skip to content

Instantly share code, notes, and snippets.

@timjacobi timjacobi/promise.js
Last active May 18, 2018

Embed
What would you like to do?
Promise Kata
// 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
You can’t perform that action at this time.