Skip to content

Instantly share code, notes, and snippets.

@pettomartino
Created February 7, 2018 21:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pettomartino/d7a07389cb5ce173f2dd3e3a4bd80c2f to your computer and use it in GitHub Desktop.
Save pettomartino/d7a07389cb5ce173f2dd3e3a4bd80c2f to your computer and use it in GitHub Desktop.
class MockPromise {
then(fn) {
this.thenFn = fn
return this
}
catch(fn) {
this.catchFn = fn
return this
}
exec(name, params) {
this[`${name}Fn`](params)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment