async await in mocha tests

Developer from somewhere

Problem: use async-await in mocha tests. Had an async test, and received this error: Error: Resolution method is overspecified. Specify a callback or return a Promise; not both.

Solution: good example here:

it("should work", done => {
  (async () => {
    await something;
    done();
  })();
});

Also, I had to require babel-polyfill in my test instruction:

./node_modules/mocha/bin/mocha –compilers js:babel-core/register –require babel-polyfill test