Skip to content

Conversation

CatsOnFilm
Copy link

Why:

The example provides a declarative import name ("axiosMock") in
anticipation for it being mocked but doesn't actually use this name
in the mock.

  • ...

This change addresses the need by:

  • updates module name from axios -> axiosMock in Full Example snippet
  • updates module name from axios -> axiosMock in Step-By-Step/Imports
    snippet
Why: The example provides a declarative import name ("axiosMock") in anticipation for it being mocked but doesn't actually use this name in the mock. * ... This change addresses the need by: - updates module name from axios -> axiosMock in `Full Example` snippet - updates module name from axios -> axiosMock in `Step-By-Step/Imports` snippet
Copy link
Collaborator

@alexkrolick alexkrolick left a comment

Choose a reason for hiding this comment

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

I believe jest.mock takes the module name as a string, which is 'axios'

@CatsOnFilm
Copy link
Author

CatsOnFilm commented Feb 5, 2020

Yes, you're right. My mistake. I thought it behaved differently and this wasn't clear from other examples (including Jest's docs), where the import is assigned the same name as the module name.

@CatsOnFilm CatsOnFilm closed this Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants