Skip to content

Support for wrapper on render #172

Closed
@OzzieOrca

Description

@OzzieOrca

Describe the Feature

Add a wrapper option to render. This would allow you to provide all the Providers and wrapping components the component under test needs to render. This would improve error messages by not having having all the irrelevant wrapping components in error logs and make update no longer require you to recreate all the wrapping JSX.

Possible Implementations

wrapper is already an option in other testing libraries:
https://testing-library.com/docs/react-testing-library/api#wrapper
https://testing-library.com/docs/react-testing-library/setup#custom-render
https://www.native-testing-library.com/docs/api-main#wrapper
https://www.native-testing-library.com/docs/setup#custom-render

A workaround for now is probably to create a helper function/component that contains all the needed providers so it can easily be passed to both render and update. But it would be nice for this to be contained in the library and not have individual tests needing to import and use a helper function for update.

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions