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

Cleanup displayName type #10010

Closed
SimenB opened this issue May 9, 2020 · 2 comments · Fixed by #10049
Closed

Cleanup displayName type #10010

SimenB opened this issue May 9, 2020 · 2 comments · Fixed by #10049

Comments

@SimenB
Copy link
Member

SimenB commented May 9, 2020

I think this is just wrong type in ProjectConfig: https://github.com/facebook/jest/blob/c6e63f331b491082075aef4c48ced355ae72add5/packages/jest-types/src/Config.ts#L87-L92.

We normalize this to an object in jest-config (if passed): https://github.com/facebook/jest/blob/c6e63f331b491082075aef4c48ced355ae72add5/packages/jest-config/src/normalize.ts#L829-L858

So type out should be either object or missing entirely, not a string.

E.g. here it deals with it just being a string, which I'm pretty sure cannot actually happen: https://github.com/facebook/jest/blob/c6e63f331b491082075aef4c48ced355ae72add5/packages/jest-reporters/src/utils.ts#L18-L34

#8612 also introduces some code around this.

@kenrick95
Copy link
Contributor

kenrick95 commented May 15, 2020

I'd like to try this out. If I understand the issue correctly, the type DisplayName should only be an object right? Thanks

kenrick95 added a commit to kenrick95/jest that referenced this issue May 15, 2020
kenrick95 added a commit to kenrick95/jest that referenced this issue May 16, 2020
Fixes jestjs#10010

Fix test

Fix test
kenrick95 added a commit to kenrick95/jest that referenced this issue May 16, 2020
@github-actions
Copy link

This issue 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 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants