Skip to content

[Feature]: add container to the exported API #23

Closed
@ematipico

Description

@ematipico
import Button from 'Button.svelte';
import {render} from 'svelte-testing-library'

const { container } = render(Button);

//..

expect(container.firstChild).toMatchSnapshot();

This will allow to create snapshot tests in a easier way. It could be a nice addition as other testing-library libraries export it. I know it's possible to use document.body but it's not intuitive and not easy for new comers

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