rsnext/docs
Hunter Tunnicliff 877f982924
Use recommended pattern in testing example (#28404)
* Use recommended pattern in testing example

Since the official linter for testing library, `eslint-plugin-testing-library` recommends using `screen` to write queries, this MR updates the testing library example to follow the pattern recommended by the linter.

> DOM Testing Library (and other Testing Library frameworks built on top of it) exports a screen object which has every query (and a debug method). This works better with autocomplete and makes each test a little simpler to write and maintain.

> This rule aims to force writing tests using built-in queries directly from screen object rather than destructuring them from render result. Given the screen component does not expose utility methods such as rerender() or the container property, it is correct to use the render returned value in those scenarios.

See the `prefer-screen-queries` rules docs for more info: https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/prefer-screen-queries.md

* Update devDependencies

* Install and configure test linting

* Use recommended pattern in test

* Update test names for consistency

* Update docs

* Set jest environment in each file

* Use root true in `with-jest` eslint config

* Ensure nested .eslintrcs are not loaded for repo lint

Co-authored-by: jj@jjsweb.site <jj@jjsweb.site>
2021-08-25 12:33:57 -05:00
..
advanced-features Update i18n locales limit to warning (#28429) 2021-08-25 08:54:38 -05:00
api-reference Improved next/image docs around layouts. (#28345) 2021-08-23 17:39:19 +00:00
api-routes Minor docs edit: cors -> CORS (#28472) 2021-08-24 17:23:40 +00:00
basic-features Update docs for sharp usage to mention Vercel (#28476) 2021-08-24 22:51:28 +00:00
migrating fix link to global stylesheet in from-create-react-app.md (#28327) 2021-08-20 12:18:27 +00:00
routing Little typo (#27911) 2021-08-10 12:01:14 +00:00
authentication.md doc: fix typo (#28146) 2021-08-16 02:51:06 +00:00
deployment.md Clarify automatic updates in deployment. (#27418) 2021-07-22 17:49:58 +00:00
faq.md Update .now.sh to .vercel.app. (#22359) 2021-04-14 09:46:06 -05:00
getting-started.md docs: updated minimum Node.js version (#26528) 2021-06-23 16:05:25 +00:00
going-to-production.md Update Going to Production docs to use quote. (#27131) 2021-07-12 23:13:52 +00:00
manifest.json [Docs] Add testing docs (#27965) 2021-08-11 20:47:12 +00:00
testing.md Use recommended pattern in testing example (#28404) 2021-08-25 12:33:57 -05:00
upgrading.md Mention customization of next.config.js to import images (#27104) 2021-07-12 13:16:13 +00:00