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

Fix location for test.each #10413

Merged
merged 12 commits into from
Sep 14, 2020
Merged

Conversation

apexskier
Copy link
Contributor

@apexskier apexskier commented Aug 16, 2020

Summary

Fixes #10412

I'm not sure what the best approach to solving this is. I don't want to add code into packages/jest-each/src/bind.ts, since the callsite stuff is runner specific. But, where the location is added in jest/packages/jest-jasmine2/src/index.ts (and circus equivalent) doesn't appear to have a way to know that the spec used each.

What I've come up isn't great. I'm basically checking if the first result found is in the jest-each module, and replacing it if so. I'd appreciate suggestions for other methods.

Test plan

Introduces failing tests that demonstrate the problem and fix them.

@apexskier apexskier force-pushed the 10412-location-in-each branch 3 times, most recently from a26fef7 to 7b9a72d Compare August 16, 2020 10:38
@apexskier apexskier marked this pull request as ready for review August 16, 2020 12:35
Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

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

I like it! Could you update the changelog as well?

packages/jest-jasmine2/src/index.ts Show resolved Hide resolved
packages/jest-circus/src/utils.ts Outdated Show resolved Hide resolved
@apexskier
Copy link
Contributor Author

Thanks for the changelog reminder!

@SimenB
Copy link
Member

SimenB commented Aug 17, 2020

@mattphillips would you be able to give this a look?

@apexskier
Copy link
Contributor Author

@mattphillips @SimenB Any updates on getting this merged?

@SimenB
Copy link
Member

SimenB commented Sep 14, 2020

I'll merge friday to give @mattphillips a few more days 🙂

Copy link
Contributor

@mattphillips mattphillips left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@SimenB
Copy link
Member

SimenB commented Jan 18, 2021

Note that this was still broken on Windows using jest-circus. I fixed that in #10871, which will be released as 27 (available now as jest@next)

@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 10, 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.

Location for test.each results is always 42,9
4 participants