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

add jest mock file #565

Merged
merged 4 commits into from
Sep 17, 2021
Merged

add jest mock file #565

merged 4 commits into from
Sep 17, 2021

Conversation

arekkubaczkowski
Copy link
Collaborator

closes #564

README.md Outdated Show resolved Hide resolved
Copy link

@thymikee thymikee left a comment

Choose a reason for hiding this comment

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

Looks good! Such default mocks are super helpful. Left a few nits

@arekkubaczkowski arekkubaczkowski changed the title WIP: add jest mock file add jest mock file Sep 16, 2021
@arekkubaczkowski arekkubaczkowski merged commit c1681a0 into master Sep 17, 2021
@arekkubaczkowski arekkubaczkowski deleted the feat/jest-mocks branch September 17, 2021 12:12
@jkepps
Copy link

jkepps commented Mar 17, 2022

is there a reason this was done in js and not ts? I'm getting a type error when i try to import this in a ts test setup file 😕

@fbartho
Copy link
Collaborator

fbartho commented Mar 17, 2022

@jkepps use // @ts-ignore in front of your require( for this mock file if you're importing it into TS.

If it was done in TS they would have had to publish it uncompiled as well for non-TS consumers. Since this is an import that exists only to cause side-effects (not to expose api elements). That's not really a heavy burden for us consumers.

@jkepps
Copy link

jkepps commented Mar 17, 2022

got it, thanks @fbartho!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a mock file for Jest
5 participants