Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions docs/svelte-testing-library/api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,16 @@ Prior to `@testing-library/svelte@5.0.0`, the `baseElement` option was named

:::

| Option | Description | Default |
| ------------- | --------------------------------------------------- | ------------------------------------------ |
| `baseElement` | The base element for queries and [`debug`](#debug). | `componentOptions.target ?? document.body` |
| `queries` | [Custom Queries][custom-queries]. | N/A |
| Option | Description | Default |
| -------------- | ----------------------------------------------------------------- | ------------------------------------------ |
| `baseElement` | The base element for queries and [`debug`](#debug). | `componentOptions.target ?? document.body` |
| `queries` | [Custom Queries][custom-queries]. | N/A |
| `wrapper` | A [wrapper component][wrappers-example] for component under test. | N/A |
| `wrapperProps` | Props to pass to the `wrapper` component. | N/A |

[custom-queries]: ../dom-testing-library/api-custom-queries.mdx
[wrappers-example]:
https://github.com/testing-library/svelte-testing-library/tree/main/examples/wrappers

### Render Results

Expand All @@ -89,6 +93,7 @@ Prior to `@testing-library/svelte@5.0.0`, the `baseElement` option was named
| [`component`](#component) | The mounted Svelte component. |
| [`container`](#container) | The DOM element the component is mounted to. |
| [`debug`](#debug) | Log elements using [`prettyDOM`][pretty-dom]. |
| [`wrapper`](#wrapper) | The mounted `wrapper` component, if provided. |
| [`rerender`](#rerender) | Update the component's props. |
| [`unmount`](#unmount) | Unmount and destroy the component. |
| [`...queries`](#queries) | [Query functions][query-functions] bound to `baseElement`. |
Expand Down Expand Up @@ -140,6 +145,14 @@ by Kent C. Dodds to understand the difference between the **end user** and

[test-user]: https://kentcdodds.com/blog/avoid-the-test-user

#### `wrapper`

_Added in `@testing-library/svelte@5.5.0`_

The instance of the [`wrapper`](#wrapper) component, if one was provided via
render options. Like [`component`](#component), this is the wrapper's exports.
`undefined` if no `wrapper` was used.

#### `debug`

Log the `baseElement` or a given element using [`prettyDOM`][pretty-dom].
Expand Down