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

Support invoke API #135

Merged
merged 1 commit into from
Apr 8, 2021
Merged

Support invoke API #135

merged 1 commit into from
Apr 8, 2021

Conversation

robertknight
Copy link
Member

@robertknight robertknight commented Apr 8, 2021

Support the invoke API [1] introduced in Enzyme v3.11.0 that invokes a
prop function within an act call and then updates the wrapper afterwards.

Currently invoke is only supported by this adapter in mount rendering. (Edit: Clarified that this is a limitation of this adapter, not Enzyme generally)

[1] https://github.com/enzymejs/enzyme/blob/master/docs/api/ReactWrapper/invoke.md

Support the `invoke` API [1] introduced in Enzyme v3.11.0 that invokes a
prop function within an `act` call and then updates the wrapper afterwards.

Currently `invoke` is only supported in `mount` rendering.

[1] https://github.com/enzymejs/enzyme/blob/master/docs/api/ReactWrapper/invoke.md
@ljharb
Copy link

ljharb commented Apr 8, 2021

To be clear, enzyme supports it in both; this PR only adds it for mount? https://github.com/enzymejs/enzyme/blob/master/docs/api/ShallowWrapper/invoke.md

@robertknight
Copy link
Member Author

robertknight commented Apr 8, 2021

To be clear, enzyme supports it in both; this PR only adds it for mount?

Yes. I've edited the PR description to clarify that this is a limitation of the Preact adapter.

@robertknight robertknight merged commit 682b042 into master Apr 8, 2021
@robertknight robertknight deleted the wrap-invoke-support branch April 8, 2021 16:20
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