Created
July 31, 2017 17:58
-
-
Save compulim/d6dcdc22a2f5e142b7cc2add6a3af4f4 to your computer and use it in GitHub Desktop.
ES6 Promise to Mocha/Jasmine done
This file contains hidden or 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
function asyncToDone(task: () => Promise<any>) { | |
return function (done: (err?: Error) => void) { | |
task().then(() => done(), done); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment