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

jest-haste-map: simplify watch-mode test structure #3623

Merged
merged 2 commits into from
May 23, 2017

Conversation

jeanlauliac
Copy link
Contributor

@jeanlauliac jeanlauliac commented May 22, 2017

I'd like to fix the problems we've had with jest not recovering from module duplication. As a first step, I propose we refactor the unit test a little bit so that it's easier to add new new tests. This is two-fold. First, I switched functions over to async/await, making it easier to read and to reduce nesting. Second, I wrote a wrapper for it() so that we can write each watch-mode test in separate jest test case. That'll gives us better reporting when things break, if they do, and does not really increase complexity, as you can see.

This changeset only switches over the very first test case. I'd like to get approval of that technique first, and I'll switch the remaining tests in a separate changeset.

Test plan

I ran:

node ./packages/jest-cli/bin/jest.js packages/jest-haste-map/src/__tests__/index-test.js

@jeanlauliac jeanlauliac requested a review from cpojer May 22, 2017 13:15
@jeanlauliac jeanlauliac changed the title jest-haste-map: simplify watch-mode test structure, final step jest-haste-map: simplify watch-mode test structure May 22, 2017
@cpojer
Copy link
Member

cpojer commented May 23, 2017

Yeah, wow, this is nice.

@cpojer cpojer merged commit 51fe8ae into jestjs:master May 23, 2017
tushardhole pushed a commit to tushardhole/jest that referenced this pull request Aug 21, 2017
* jest-haste-map: simplify watch-mode test structure, first step

* jest-haste-map: simplify watch-mode test structure, final step
@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 13, 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.

3 participants