Skip to content

Commit 61508bb

Browse files
authored
Cjs type definitions (#44)
cjs type defintions
1 parent 8508089 commit 61508bb

3 files changed

Lines changed: 222 additions & 187 deletions

File tree

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,16 @@ Solid.js reactive changes are pretty instantaneous, so there is rarely need to u
8181
⚠️ 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:
8282

8383
```tsx
84-
const App = () => (
85-
<Routes>
86-
<Route path="/ids/:id" component={() => <p>Id: {useParams()?.id}</p>} />
87-
<Route path="/" component={() => <p>Start</p>} />
88-
</Routes>
89-
);
90-
const { findByText } = render(() => <App />, { location: "ids/1234" });
91-
expect(findByText("Id: 1234")).not.toBeFalsy();
84+
it('uses params', () => {
85+
const App = () => (
86+
<Routes>
87+
<Route path="/ids/:id" component={() => <p>Id: {useParams()?.id}</p>} />
88+
<Route path="/" component={() => <p>Start</p>} />
89+
</Routes>
90+
);
91+
const { findByText } = render(() => <App />, { location: "ids/1234" });
92+
expect(await findByText("Id: 1234")).not.toBeFalsy();
93+
});
9294
```
9395

9496
⚠️ 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.

0 commit comments

Comments
 (0)