Skip to content

Return the component from render #3

Closed
@EmilTholin

Description

@EmilTholin

It might be beneficial to return rendered from the render function. It's a very pleasent testing experience to $set props (or use getters and setters when compiled with accessors: true) on the component in order to test that it is working properly.

What do you think?

export const render = (Component, options) => {
  // ...

  return {
+   component: rendered,
    ...getQueriesForElement(document.body),
  }
}

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