Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Add synchronous test.each setup #7150

Merged
merged 4 commits into from
Oct 14, 2018

Conversation

mattphillips
Copy link
Contributor

@mattphillips mattphillips commented Oct 12, 2018

Summary

Add a note on test.each synchronous setup.

Motivation: #7100 (comment)

Test plan

screen shot 2018-10-12 at 17 59 26

@mattphillips mattphillips changed the title Synchronous tests [docs] Add synchronous test.each setup Oct 12, 2018
@SimenB
Copy link
Member

SimenB commented Oct 12, 2018

This is not specific to test/describe.each, IMO it should be in https://jestjs.io/docs/en/troubleshooting or something.

@mattphillips
Copy link
Contributor Author

True its not! I debated putting it in there I just didn't know if it was a bit too hidden?

@SimenB
Copy link
Member

SimenB commented Oct 12, 2018

Meh, I'm fine with pointing people to it, then hopefully google will do the rest when people start searching for why it fails :P
Maybe not, though?

@mattphillips
Copy link
Contributor Author

Cool I can update this to just be in the troubleshooting docs

@mattphillips
Copy link
Contributor Author

@SimenB I've updated this to put the docs in troubleshooting

@@ -192,6 +192,23 @@ Jest takes advantage of new features added to Node 6. We recommend that you upgr

Make sure you are not using the `babel-plugin-istanbul` plugin. Jest wraps Istanbul, and therefore also tells Istanbul what files to instrument with coverage collection. When using `babel-plugin-istanbul`, every file that is processed by Babel will have coverage collection code, hence it is not being ignored by `coveragePathIgnorePatterns`.

## Defining Tests

Tests much be defined synchronously for Jest to be able to collect your tests.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/much/must

@@ -193,6 +193,23 @@ Jest takes advantage of new features added to Node 6. We recommend that you upgr

Make sure you are not using the `babel-plugin-istanbul` plugin. Jest wraps Istanbul, and therefore also tells Istanbul what files to instrument with coverage collection. When using `babel-plugin-istanbul`, every file that is processed by Babel will have coverage collection code, hence it is not being ignored by `coveragePathIgnorePatterns`.

## Defining Tests

Tests much be defined synchronously for Jest to be able to collect your tests.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

Copy link
Member

@rickhanlonii rickhanlonii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM just fix the typo


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`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we should have the example above the mention of .each.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in 716bc5f :)

@SimenB
Copy link
Member

SimenB commented Oct 14, 2018

Hopefully we'll get less reports about this now 🙂

@SimenB SimenB merged commit 5cd7d17 into jestjs:master Oct 14, 2018
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants