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 duplicate mocks names warning #75135

Closed
shahzad31 opened this issue Aug 17, 2020 · 5 comments
Closed

Jest duplicate mocks names warning #75135

shahzad31 opened this issue Aug 17, 2020 · 5 comments
Labels
Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:SIEM

Comments

@shahzad31
Copy link
Contributor

shahzad31 commented Aug 17, 2020

While running in jest tests in kibana x-pack, it starts with bunch of warnings about duplicate mock file names, either we should try to rename those mocks or try to suppress this warning.

It pollutes the terminal each and every time.

Most of these mocks are from enterprise_search and security_solutions apps.

image

@elasticmachine
Copy link
Contributor

Pinging @elastic/siem (Team:SIEM)

@shahzad31
Copy link
Contributor Author

not sure which team represents enterprise_search team, so not able to tag them.

@timroes
Copy link
Contributor

timroes commented Aug 17, 2020

This is nothing the enterprise search team can solve. This is a bug in Jest (jestjs/jest#2070), see my description in #38760

@shahzad31
Copy link
Contributor Author

shahzad31 commented Aug 17, 2020

This is nothing the enterprise search team can solve. This is a bug in Jest (facebook/jest#2070), see my description in #38760

@timroes can't we just manually rename them to solve this? taking a look at enterprise search team mocks, those looks pretty straightforward to rename, for security team , there are ton of them especially it would be probably tricky in case of jest.mock("../__mock__/") pattern.

@timroes
Copy link
Contributor

timroes commented Aug 17, 2020

The mocks should have the names of their corresponding files, so unless you don't want to rename all files (which for index.ts would already not be a very reasonable decision), I am not sure if that's a reasonable way to go, but of course I leave that decicion to someone from the team.

@MindyRS MindyRS added the Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. label Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:SIEM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants