Created
August 11, 2017 22:14
-
-
Save supasympa/b6a23822dbfae96d08e8740980163ac1 to your computer and use it in GitHub Desktop.
Simple Mocha async/await example
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
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