Skip to content

Commit

Permalink
Reorder synchronous test docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mattphillips committed Oct 14, 2018
1 parent 72fd039 commit 716bc5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions docs/Troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,7 @@ Make sure you are not using the `babel-plugin-istanbul` plugin. Jest wraps Istan
## Defining Tests
Tests much be defined synchronously for Jest to be able to collect your tests.
This means when you are using `test.each` you cannot set the table asynchronously within a `beforeEach` / `beforeAll`.
Tests must be defined synchronously for Jest to be able to collect your tests.
As an example to show why this is the case, imagine we wrote a test like so:
Expand All @@ -209,6 +207,8 @@ setTimeout(() => {

When Jest runs your test to collect the `test`s it will not find any because we have set the definition to happen asynchronously on the next tick of the event loop.

_Note:_ This means when you are using `test.each` you cannot set the table asynchronously within a `beforeEach` / `beforeAll`.

## Still unresolved?

See [Help](/help.html).
8 changes: 5 additions & 3 deletions website/versioned_docs/version-23.6/Troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,7 @@ Make sure you are not using the `babel-plugin-istanbul` plugin. Jest wraps Istan
## Defining Tests
Tests much be defined synchronously for Jest to be able to collect your tests.
This means when you are using `test.each` you cannot set the table asynchronously within a `beforeEach` / `beforeAll`.
Tests must be defined synchronously for Jest to be able to collect your tests.
As an example to show why this is the case, imagine we wrote a test like so:
Expand All @@ -210,6 +208,10 @@ setTimeout(() => {

When Jest runs your test to collect the `test`s it will not find any because we have set the definition to happen asynchronously on the next tick of the event loop.

_Note:_ This means when you are using `test.each` you cannot set the table asynchronously within a `beforeEach` / `beforeAll`.

When Jest runs your test to collect the `test`s it will not find any because we have set the definition to happen asynchronously on the next tick of the event loop.

## Still unresolved?

See [Help](/help.html).

0 comments on commit 716bc5f

Please sign in to comment.