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() @@ -511,7 +515,7 @@ Thanks goes to these people ([emoji key][emojis]):
Monica Powell

πŸ“–
Vitaly Sivkov

πŸ’» -
Weyert de Boer

πŸ€” πŸ‘€ +
Weyert de Boer

πŸ€” πŸ‘€ 🎨
EstebanMarin

πŸ“–
Victor Martins

πŸ“–
Royston Shufflebotham

πŸ› πŸ“– πŸ’‘ @@ -577,12 +581,14 @@ Thanks goes to these people ([emoji key][emojis]):
Steven Fitzpatrick

πŸ›
Juan Je GarcΓ­a

πŸ“–
Championrunner

πŸ“– -
Sam Tsai

πŸ’» ⚠️ +
Sam Tsai

πŸ’» ⚠️ πŸ“–
Christian Rackerseder

πŸ’»
Andrei Picus

πŸ› πŸ‘€
Artem Zakharchenko

πŸ“– +
Michael

πŸ“– +
Braden Lee

πŸ“– diff --git a/other/cheat-sheet.pdf b/other/cheat-sheet.pdf index 3cafbc3a..8f1d1e60 100644 Binary files a/other/cheat-sheet.pdf and b/other/cheat-sheet.pdf differ diff --git a/other/design files/README.txt b/other/design files/README.txt new file mode 100644 index 00000000..ac8b1325 --- /dev/null +++ b/other/design files/README.txt @@ -0,0 +1,13 @@ +# Cheat sheet design + +The cheat sheet document has been created using the desktop publishing software called Affinity Publisher, the original source file can be found in this folder + +## Fonts used + +- Menlo +- Arial + +## Standard distances + +15pt between boxes +8pt margin from box edge to inner text \ No newline at end of file diff --git a/other/design files/cheat-sheet.afpub b/other/design files/cheat-sheet.afpub new file mode 100644 index 00000000..73c75ca0 Binary files /dev/null and b/other/design files/cheat-sheet.afpub differ diff --git a/package.json b/package.json index 9c62dcf6..5da3b5d5 100644 --- a/package.json +++ b/package.json @@ -44,19 +44,20 @@ "license": "MIT", "dependencies": { "@babel/runtime": "^7.10.2", - "@testing-library/dom": "^7.9.0" + "@testing-library/dom": "^7.14.2" }, "devDependencies": { "@reach/router": "^1.3.3", - "@testing-library/jest-dom": "^5.9.0", + "@testing-library/jest-dom": "^5.10.0", "@types/react-dom": "^16.9.8", "dotenv-cli": "^3.1.0", - "dtslint": "3.6.9", - "kcd-scripts": "^6.2.0", + "dtslint": "3.6.12", + "kcd-scripts": "^6.2.3", "npm-run-all": "^4.1.5", "react": "^16.13.1", "react-dom": "^16.13.1", - "rimraf": "^3.0.2" + "rimraf": "^3.0.2", + "typescript": "^3.9.5" }, "peerDependencies": { "react": "*",