diff --git a/.all-contributorsrc b/.all-contributorsrc
index bd36c4bb..cf2f3bdd 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -576,7 +576,8 @@
"profile": "https://github.com/weyert",
"contributions": [
"ideas",
- "review"
+ "review",
+ "design"
]
},
{
@@ -1071,7 +1072,8 @@
"profile": "https://github.com/samtsai",
"contributions": [
"code",
- "test"
+ "test",
+ "doc"
]
},
{
@@ -1101,6 +1103,24 @@
"contributions": [
"doc"
]
+ },
+ {
+ "login": "michael-siek",
+ "name": "Michael",
+ "avatar_url": "https://avatars0.githubusercontent.com/u/45568605?v=4",
+ "profile": "http://michaelsiek.com",
+ "contributions": [
+ "doc"
+ ]
+ },
+ {
+ "login": "2dubbing",
+ "name": "Braden Lee",
+ "avatar_url": "https://avatars2.githubusercontent.com/u/15885679?v=4",
+ "profile": "http://2dubbing.tistory.com",
+ "contributions": [
+ "doc"
+ ]
}
],
"contributorsPerLine": 7,
diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md
index abcfc35e..85d31914 100644
--- a/.github/ISSUE_TEMPLATE.md
+++ b/.github/ISSUE_TEMPLATE.md
@@ -76,7 +76,7 @@ Reproduction repository:
### What you did:
@@ -63,7 +63,7 @@ https://github.com/alexkrolick/testing-library-docs
If possible, please create a repository that reproduces the issue with the
minimal amount of code possible.
-Template repo: https://github.com/alexkrolick/dom-testing-library-template
+Template repo: https://github.com/testing-library/dom-testing-library-template
Or if you can, try to reproduce the issue in a Codesandbox. You can fork the one
here: https://codesandbox.io/s/5z6x4r7n0p
diff --git a/.github/ISSUE_TEMPLATE/Question.md b/.github/ISSUE_TEMPLATE/Question.md
index 3fd359af..3a4d1ca2 100644
--- a/.github/ISSUE_TEMPLATE/Question.md
+++ b/.github/ISSUE_TEMPLATE/Question.md
@@ -20,6 +20,6 @@ codesandbox to make a reproduction of your issue: https://kcd.im/rtl-help
- Reactiflux on Discord https://www.reactiflux.com
- Stack Overflow
https://stackoverflow.com/questions/tagged/react-testing-library
-- Documentation: https://github.com/alexkrolick/testing-library-docs
+- Documentation: https://github.com/testing-library/testing-library-docs
**ISSUES WHICH ARE QUESTIONS WILL BE CLOSED**
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index e3b54b33..371a86f6 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -35,7 +35,7 @@ merge of your pull request!
- [ ] Documentation added to the
- [docs site](https://github.com/alexkrolick/testing-library-docs)
+ [docs site](https://github.com/testing-library/testing-library-docs)
- [ ] Tests
- [ ] Typescript definitions updated
- [ ] Ready to be merged
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index de766c7a..f3867b62 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -34,8 +34,13 @@ sure to include those changes (if they exist) in your commit.
### Update Typings
-The TypeScript type definitions are in the
-[DefinitelyTyped repo](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/testing-library__react)
+If your PR introduced some changes in the API, you are more than welcome to
+modify the Typescript type definition to reflect those changes. Just modify the
+`/types/index.d.ts` file accordingly. If you have never seen Typescript
+definitions before, you can read more about it in its
+[documentation pages](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html).
+Though this library itself is not written in Typescript we use
+[dtslint](https://github.com/microsoft/dtslint) to lint our typings.
## Help needed
diff --git a/README.md b/README.md
index bbed1d59..4745997c 100644
--- a/README.md
+++ b/README.md
@@ -101,9 +101,11 @@ should be installed as one of your project's `devDependencies`:
```
npm install --save-dev @testing-library/react
```
+
or
for installation via [yarn](https://classic.yarnpkg.com/en/)
+
```
yarn add --dev @testing-library/react
```
@@ -173,7 +175,9 @@ function HiddenMessage({children}) {
}
export default HiddenMessage
+```
+```jsx
// __tests__/hidden-message.js
// these imports are something you'd normally configure Jest to import for you
// automatically. Learn more in the setup docs: https://testing-library.com/docs/react-testing-library/setup#cleanup
@@ -281,11 +285,14 @@ import Login from '../login'
const server = setupServer(
rest.post('/api/login', (req, res, ctx) => {
return res(ctx.json({token: 'fake_user_token'}))
- })
+ }),
)
beforeAll(() => server.listen())
-afterEach(() => server.resetHandlers())
+afterEach(() => {
+ server.resetHandlers()
+ window.localStorage.removeItem('token')
+})
afterAll(() => server.close())
test('allows the user to login successfully', async () => {
@@ -316,11 +323,8 @@ test('handles server exceptions', async () => {
// mock the server error response for this test suite only.
server.use(
rest.post('/', (req, res, ctx) => {
- return res(
- ctx.status(500),
- ctx.json({message: 'Internal server error'}),
- )
- })
+ return res(ctx.status(500), ctx.json({message: 'Internal server error'}))
+ }),
)
render(