diff --git a/docs/index.md b/docs/index.md index cf6896a0bf..d841fdf77a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -296,6 +296,10 @@ describe('#find()', function () { }); ``` +### Limitations of asynchronous callbacks + +You can use all three asynchronous patterns (`done`, `Promise`, and `async`/`await`) in callbacks for `it()` and for all hooks (`before()`, `after()`, `beforeEach()`, `afterEach()`), but `describe()` will not work correctly with an asynchronous callback -- it must be synchronous. This is because in the "parsing" cycle all `describe` callbacks are executed and the test hierarchy (`runner`) is created before any tests are run. + ## Synchronous Code When testing synchronous code, omit the callback and Mocha will automatically continue on to the next test.