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 automock for numeric function names #7653

Merged
merged 3 commits into from
Jan 19, 2019

Conversation

jeysal
Copy link
Contributor

@jeysal jeysal commented Jan 19, 2019

Summary

Fixes #7624

Test plan

Added one assertion for the name itself and
added one test case that should closely resembles #7624

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.

Thanks! I was unaware we already had logic for this, turned out really clean

expect(
getMockFnWithOriginalName('foo𠮷bar').name === 'foo𠮷bar',
).toBeTruthy();
expect(getMockFnWithOriginalName('1').name).toBe('$1');
Copy link
Member

Choose a reason for hiding this comment

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

good call

packages/jest-mock/src/index.js Outdated Show resolved Hide resolved
@SimenB SimenB merged commit fd290a0 into jestjs:master Jan 19, 2019
thymikee added a commit to thymikee/jest that referenced this pull request Jan 20, 2019
…m-runtime

* upstream/master:
  add missing truncate comment to recent blog posts (jestjs#7655)
  use raw serializer for e2e output snapshots (jestjs#7651)
  chore: use a Set for reserved words list in `jest-mock`
  Fix automock for numeric function names (jestjs#7653)
  Update docs re: `moduleFileExtensions` to add ordering note (left-to-right) (jestjs#7616)
captain-yossarian pushed a commit to captain-yossarian/jest that referenced this pull request Jul 18, 2019
@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.

jest.mock module auto-mock error when Function names are numeric
3 participants