Skip to content

Commit 68a240b

Browse files
committed
chore: setup move to @testing-library/preact
1 parent 6ecd20d commit 68a240b

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

.all-contributorsrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"projectName": "preact-testing-library",
3-
"projectOwner": "mihar-22",
3+
"projectOwner": "testing-library",
44
"repoType": "github",
55
"files": [
66
"README.md"

README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,23 +78,25 @@ This module is distributed via [npm][npm] which is bundled with [node][node] and
7878
as 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

99101
const { returns } = render(<YourComponent />, { arguments })
100102
```
@@ -125,7 +127,7 @@ Unmounts the component from the container and destroys the container.
125127
to 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

130132
afterEach(() => {
131133
cleanup
@@ -256,7 +258,7 @@ function HiddenMessage({ children }) {
256258
import '@testing-library/jest-dom/extend-expect'
257259

258260
import { h } from 'preact'
259-
import { render, fireEvent } from 'preact-testing-library'
261+
import { render, fireEvent } from '@testing-library/preact'
260262
import HiddenMessage from '../hidden-message'
261263

262264
test('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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "preact-testing-library",
2+
"name": "@testing-library/preact",
33
"version": "0.0.0-semantically-released",
44
"description": "Simple and complete Preact DOM testing utilities that encourage good testing practices.",
55
"main": "dist/index.js",

pure.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
// Makes it so people can import from 'preact-testing-library/pure'
1+
// Makes it so people can import from '@testing-library/preact/pure'
22
module.exports = require('./dist/pure');

0 commit comments

Comments
 (0)