Skip to content

Instantly share code, notes, and snippets.

@supasympa
Created August 11, 2017 22:14
Show Gist options
  • Save supasympa/b6a23822dbfae96d08e8740980163ac1 to your computer and use it in GitHub Desktop.
Save supasympa/b6a23822dbfae96d08e8740980163ac1 to your computer and use it in GitHub Desktop.
Simple Mocha async/await example
const chai = require('chai');
const expect = chai.expect;
describe('An async await test', () => {
it(`Should work.`, async () => {
const HELLO_WORLD = "Hello World!";
const run = Promise.resolve(HELLO_WORLD);
const message = await run;
expect(message).to.equal(HELLO_WORLD);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment