Skip to content

Instantly share code, notes, and snippets.

@esamattis
Last active January 25, 2016 05:06
Show Gist options
  • Save esamattis/1c212ca9d8e29d424e54 to your computer and use it in GitHub Desktop.
Save esamattis/1c212ca9d8e29d424e54 to your computer and use it in GitHub Desktop.
"use strict";
var Promise = require("bluebird");
describe("ES7 async functions in Mocha", function() {
it("are really cool!", async function(){
console.log("waiting...");
await Promise.delay(1000);
console.log("done");
});
});
@esamattis
Copy link
Author

Async function works here because it returns a promise and mocha supports promises out of the box

@douglasduteil
Copy link

Cool :)

@gobengo
Copy link

gobengo commented Feb 22, 2015

Yay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment