Skip to content

Commit bd3f76f

Browse files
author
Alex Lohr
committed
docs hotfixes
1 parent 61508bb commit bd3f76f

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ const results = render(() => <YourComponent />, options);
7676

7777
⚠️ Solid.js does *not* re-render, it merely executes side effects triggered by reactive state that change the DOM, therefore there is no `rerender` method. You can use global signals to manipulate your test component in a way that causes it to update.
7878

79-
Solid.js reactive changes are pretty instantaneous, so there is rarely need to use `waitFor(…)` or `await findByRole(…)`, except for transitions, suspense and router navigation.
79+
Solid.js reactive changes are pretty instantaneous, so there is rarely need to use `waitFor(…)`, `await findByRole(…)` and other asynchronous queries to test the rendered result, except for transitions, suspense, resources and router navigation.
8080

81-
⚠️ In extension of the original API, this testing library supports convenient `location` and `routeDataFunc` options that will set up a router with memory integration pointing at a certain path if `location` is given and primed with the `routeDataFunc` as data. Since this setup is not instantaneous, you need to first use asynchronous queries (`findBy`) after employing it:
81+
⚠️ In extension of the original API, the render function of this testing library supports convenient `location` and `routeDataFunc` options that will set up a router with memory integration pointing at a certain path if `location` is given and primed with the `routeDataFunc` as data. Since this setup is not instantaneous, you need to first use asynchronous queries (`findBy`) after employing it:
8282

8383
```tsx
84-
it('uses params', () => {
84+
it('uses params', async () => {
8585
const App = () => (
8686
<Routes>
8787
<Route path="/ids/:id" component={() => <p>Id: {useParams()?.id}</p>} />
@@ -93,6 +93,8 @@ it('uses params', () => {
9393
});
9494
```
9595

96+
It uses `@solidjs/router`, so if you want to use a different router, you should consider the `wrapper` option instead. If you attempt to use this without having the package installed, you will receive an error message.
97+
9698
⚠️ Solid.js external reactive state does not require any DOM elements to run in, so our `renderHook` call has no `container`, `baseElement` or queries in its options or return value. Instead, it has an `owner` to be used with [`runWithOwner`](https://www.solidjs.com/docs/latest/api#runwithowner) if required. It also exposes a `cleanup` function, though this is already automatically called after the test is finished.
9799

98100
```ts

0 commit comments

Comments
 (0)