@@ -78,23 +78,25 @@ This module is distributed via [npm][npm] which is bundled with [node][node] and
7878as one of your project's ` devDependencies ` :
7979
8080```
81- npm install --save-dev preact- testing-library
81+ npm install --save-dev @ testing-library/preact
8282```
8383
84- This library has ` peerDependencies ` listings for ` preact ` .
84+ This library has ` peerDependencies ` listings for ` preact >= 10 ` .
8585
8686💡 You may also be interested in installing ` @testing-library/jest-dom ` so you can use
8787[ the custom jest matchers] ( https://github.com/testing-library/jest-dom ) .
8888
8989📝 This library supports Preact X (10.x). It takes advantage of the ` act ` test utility in
9090` preact/test-utils ` to enable both Preact Hook and Class components to be easily tested.
9191
92+ 📝 If you're looking for a solution for Preact 8.x then install ` preact-testing-library ` .
93+
9294## Usage
9395
9496### ` render `
9597
9698``` jsx
97- import { render } from ' preact- testing-library'
99+ import { render } from ' @ testing-library/preact '
98100
99101const { returns } = render (< YourComponent / > , { arguments })
100102```
@@ -125,7 +127,7 @@ Unmounts the component from the container and destroys the container.
125127to disable this then set ` process.env.PTL_SKIP_AUTO_CLEANUP ` to true when running your tests.
126128
127129``` jsx
128- import { render , cleanup } from ' preact- testing-library'
130+ import { render , cleanup } from ' @ testing-library/preact '
129131
130132afterEach (() => {
131133 cleanup
@@ -256,7 +258,7 @@ function HiddenMessage({ children }) {
256258import ' @testing-library/jest-dom/extend-expect'
257259
258260import { h } from ' preact'
259- import { render , fireEvent } from ' preact- testing-library'
261+ import { render , fireEvent } from ' @ testing-library/preact '
260262import HiddenMessage from ' ../hidden-message'
261263
262264test (' shows the children when the checkbox is checked' , () => {
@@ -346,9 +348,9 @@ Thanks goes to these people ([emoji key][emojis]):
346348<!-- markdownlint-disable -->
347349<table>
348350 <tr>
349- <td align="center"><a href="https://kentcdodds.com"><img src="https://avatars.githubusercontent.com/u/1500684?v=3" width="100px;" alt="Kent C. Dodds"/><br /><sub><b>Kent C. Dodds</b></sub></a><br /><a href="https://github.com/mihar-22 /preact-testing-library/commits?author=kentcdodds" title="Code">💻</a> <a href="https://github.com/mihar-22 /preact-testing-library/commits?author=kentcdodds" title="Documentation">📖</a> <a href="https://github.com/mihar-22 /preact-testing-library/commits?author=kentcdodds" title="Tests">⚠️</a></td>
350- <td align="center"><a href="https://github.com/antsmartian"><img src="https://avatars0.githubusercontent.com/u/1241511?s=400&v=4" width="100px;" alt="Ants Martian"/><br /><sub><b>Ants Martian</b></sub></a><br /><a href="https://github.com/mihar-22 /preact-testing-library/commits?author=antsmartian" title="Code">💻</a> <a href="https://github.com/mihar-22 /preact-testing-library/commits?author=antsmartian" title="Documentation">📖</a> <a href="https://github.com/mihar-22 /preact-testing-library/commits?author=antsmartian" title="Tests">⚠️</a></td>
351- <td align="center"><a href="https://github.com/mihar-22"><img src="https://avatars3.githubusercontent.com/u/14304599?s=460&v=4" width="100px;" alt="Rahim Alwer"/><br /><sub><b>Rahim Alwer</b></sub></a><br /><a href="https://github.com/mihar-22 /preact-testing-library/commits?author=mihar-22" title="Code">💻</a> <a href="https://github.com/mihar-22 /preact-testing-library/commits?author=mihar-22" title="Documentation">📖</a> <a href="https://github.com/mihar-22 /preact-testing-library/commits?author=mihar-22" title="Tests">⚠️</a> <a href="#infra-mihar-22" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
351+ <td align="center"><a href="https://kentcdodds.com"><img src="https://avatars.githubusercontent.com/u/1500684?v=3" width="100px;" alt="Kent C. Dodds"/><br /><sub><b>Kent C. Dodds</b></sub></a><br /><a href="https://github.com/testing-library /preact-testing-library/commits?author=kentcdodds" title="Code">💻</a> <a href="https://github.com/testing-library /preact-testing-library/commits?author=kentcdodds" title="Documentation">📖</a> <a href="https://github.com/testing-library /preact-testing-library/commits?author=kentcdodds" title="Tests">⚠️</a></td>
352+ <td align="center"><a href="https://github.com/antsmartian"><img src="https://avatars0.githubusercontent.com/u/1241511?s=400&v=4" width="100px;" alt="Ants Martian"/><br /><sub><b>Ants Martian</b></sub></a><br /><a href="https://github.com/testing-library /preact-testing-library/commits?author=antsmartian" title="Code">💻</a> <a href="https://github.com/testing-library /preact-testing-library/commits?author=antsmartian" title="Documentation">📖</a> <a href="https://github.com/testing-library /preact-testing-library/commits?author=antsmartian" title="Tests">⚠️</a></td>
353+ <td align="center"><a href="https://github.com/mihar-22"><img src="https://avatars3.githubusercontent.com/u/14304599?s=460&v=4" width="100px;" alt="Rahim Alwer"/><br /><sub><b>Rahim Alwer</b></sub></a><br /><a href="https://github.com/testing-library /preact-testing-library/commits?author=mihar-22" title="Code">💻</a> <a href="https://github.com/testing-library /preact-testing-library/commits?author=mihar-22" title="Documentation">📖</a> <a href="https://github.com/testing-library /preact-testing-library/commits?author=mihar-22" title="Tests">⚠️</a> <a href="#infra-mihar-22" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
352354 </tr>
353355</table>
354356
@@ -371,9 +373,9 @@ kind welcome!
371373[build-badge]: https://travis-ci.org/testing-library/preact-testing-library.svg?branch=master
372374[coverage-badge]: https://img.shields.io/codecov/c/github/testing-library/preact-testing-library.svg?style=flat-square
373375[coverage]: https://codecov.io/github/testing-library/preact-testing-library
374- [package]: https://www.npmjs.com/package/preact- testing-library
375- [version-badge]: https://img.shields.io/npm/v/preact- testing-library
376- [downloads-badge]: https://img.shields.io/npm/dw/preact- testing-library
376+ [package]: https://www.npmjs.com/package/@ testing-library/preact
377+ [version-badge]: https://img.shields.io/npm/v/@ testing-library/preact
378+ [downloads-badge]: https://img.shields.io/npm/dw/@ testing-library/preact
377379[slack]: https://preact-slack.now.sh
378380[license]: https://github.com/testing-library/preact-testing-library/blob/master/LICENSE
379381[license-badge]: https://img.shields.io/github/license/testing-library/preact-testing-library?color=b
0 commit comments