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

Update Jest #1084

Closed
fedekunze opened this issue Aug 7, 2018 · 2 comments
Closed

Update Jest #1084

fedekunze opened this issue Aug 7, 2018 · 2 comments
Labels

Comments

@fedekunze
Copy link
Contributor

UI Version: 0.9.3

Description:

Updated my dependencies on package.json and by upgrading jest from 21.2.1 to 23.4.2 all my test broke and threw the same error:

  ● Test suite failed to run

    TypeError: jest.genMockFunction is not a function

       7 | global._Date = Date
       8 | global.Date = jest.fn(() => new global._Date(DATE_TO_USE.toISOString()))
    >  9 | Date.now = jest.genMockFunction().mockReturnValue(DATE_TO_USE.getTime())

Had to downgrade to de prev version to solve the issue, but in the long run we might have to change how we mock dates using jest.

See the following issue:

@fedekunze fedekunze added bug 🐛 issues related to unhandled errors in the code that need to be fixed discuss labels Aug 7, 2018
@NodeGuy
Copy link
Contributor

NodeGuy commented Aug 7, 2018

A better choice is to stop using mocks in accordance with my talk.

@faboweb faboweb changed the title jest.genMockFunction deprecation breaks all tests Update Jest Aug 14, 2018
@faboweb faboweb removed the bug 🐛 issues related to unhandled errors in the code that need to be fixed label Aug 14, 2018
@faboweb
Copy link
Collaborator

faboweb commented Aug 16, 2018

Spiked this:

  • not straight forward
  • will need some investigation to solve strange bugs

Don't underestimate this.

@faboweb faboweb removed the discuss label Aug 21, 2018
@faboweb faboweb closed this as completed Mar 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants