Skip to content

Commit

Permalink
README: Add instructions for a world with async/await
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 committed Dec 10, 2016
1 parent ceed29b commit 800323d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,20 @@ also add `return wait();` to the end of your acceptance tests.
While this currently still works without the `return`, it will fail once
this library is updated to Mocha 3.x!

In case your project supports the `async/await` feature of ES2016 you can
simplify the test function to this:

```js
it('can visit /', async function() {
await visit('/');
expect(currentURL()).to.equal('/');
});
```

- add the `async` keyword in front of the test `function`
- add `await` in front of all async test helper calls
- remove the `andThen()` wrappers


Upgrading
------------------------------------------------------------------------------
Expand Down

0 comments on commit 800323d

Please sign in to comment.