Skip to content

Render JSX in t.snapshot arguments #1214

Closed
@vadimdemedes

Description

@vadimdemedes

See #1154 (comment). During the development of magic-assert PR, we decided to extract t.jsxEqual from it and land it bit later with a more clear purpose.

I do have one idea for these, but not sure if that can be implemented to be stable enough. We (or community) could write a babel plugin for react/preact/inferno, which detects t.jsxEqual and convert:

t.jsxEqual(<This/>, <That/>);

into:

t.jsxEqual(renderer.create(<This/>).toJSON(), renderer.create(<That/>).toJSON());

to save the user from typing that manually or creating shortcuts (as mentioned in #1175).


Also related #1175

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions