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

Expose custom return type for our mount function #63

Merged
merged 1 commit into from
Dec 19, 2024
Merged

Conversation

acelaya
Copy link
Contributor

@acelaya acelaya commented Dec 19, 2024

Supersedes #62

Add a custom type definition for the objects returned by our mount() function.

The type is based on the "official" enzyme types from DefinitelyTyped, but ignoring ShallowWrapper and the methods we don't use from ReactWrapper.

I also decided to name the main type ComponentWrapper, to avoid coupling the name with a specific UI framework, but I don't have a strong opinion about this name.

I checked client, frontend-shared, lms, h and via to see what parts of the wrapper object were already in use, and defined them here.

I also tested this via yalc in client project, and verified my IDE is now smarter about code autocompletion.

@acelaya acelaya requested a review from robertknight December 19, 2024 10:19
@acelaya acelaya force-pushed the mount-types branch 2 times, most recently from 4b80800 to ece454e Compare December 19, 2024 10:22
@acelaya acelaya merged commit fd5d0ae into main Dec 19, 2024
2 checks passed
@acelaya acelaya deleted the mount-types branch December 19, 2024 11:24
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.

2 participants