Skip to content

Commit e91fb71

Browse files
committed
docs(svelte): remove warning on using component from rendered results and provide use cases
1 parent 56bd607 commit e91fb71

File tree

1 file changed

+8
-8
lines changed
  • docs/svelte-testing-library

1 file changed

+8
-8
lines changed

docs/svelte-testing-library/api.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ Please refer to the
5050

5151
### Results
5252

53-
| Result | Description |
54-
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
55-
| `container` | The HTML element the component is mounted into. |
56-
| `component` | The newly created Svelte component. **Please do not use this, it will most likely be removed in a future release.** Using this method goes against the testing libraries guiding principles. |
57-
| `debug` | Logs the baseElement using [prettyDom](https://testing-library.com/docs/dom-testing-library/api-helpers#prettydom). |
58-
| `unmount` | Unmounts the component from the `target` by calling `component.$destroy()`. |
59-
| `rerender` | Calls render again destroying the old component, and mounting the new component on the original `target` with any new options passed in. |
60-
| `...queries` | Returns all [query functions](https://testing-library.com/docs/dom-testing-library/api-queries) that are binded to the `container`. If you pass in `query` arguments than this will be those, otherwise all. |
53+
| Result | Description |
54+
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
55+
| `container` | The HTML element the component is mounted into. |
56+
| `component` | The newly created Svelte component. This is mostly useful for testing exported functions or cases where manipulating the DOM doesn't fit. Outside of said cases avoid using the component directly to build tests, instead of interacting with the rendered Svelte component, work with the DOM . |
57+
| `debug` | Logs the baseElement using [prettyDom](https://testing-library.com/docs/dom-testing-library/api-helpers#prettydom). |
58+
| `unmount` | Unmounts the component from the `target` by calling `component.$destroy()`. |
59+
| `rerender` | Calls render again destroying the old component, and mounting the new component on the original `target` with any new options passed in. |
60+
| `...queries` | Returns all [query functions](https://testing-library.com/docs/dom-testing-library/api-queries) that are binded to the `container`. If you pass in `query` arguments than this will be those, otherwise all. |
6161

6262
## `cleanup`
6363

0 commit comments

Comments
 (0)