Skip to content

Commit 672b1ef

Browse files
authored
chore: Format docs with prettier (testing-library#956)
1 parent d37e9e6 commit 672b1ef

File tree

9 files changed

+38
-29
lines changed

9 files changed

+38
-29
lines changed

docs/ecosystem-jest-native.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ npm install --save-dev @testing-library/jest-native
1313
```
1414

1515
```javascript
16-
<View>
16+
;<View>
1717
<View testID="not-empty">
1818
<Text testID="empty" />
1919
</View>

docs/ecosystem-user-event.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ set `skipPointerEventsCheck` to `true`:
9393
userEvent.click(elem, undefined, {skipPointerEventsCheck: true})
9494
```
9595

96-
The `skipPointerEventsCheck` option can be passed to any pointer related API including:
96+
The `skipPointerEventsCheck` option can be passed to any pointer related API
97+
including:
98+
9799
- [dblClick](#dblclickelement-eventinit-options)
98100
- [hover](#hoverelement-options)
99101
- [unhover](#unhoverelement-options)

docs/learning.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ sidebar_label: Learning Material
4141
by [Billy Mathews](https://twitter.com/BillRMathews)
4242
- [React Hooks broke my tests, now what?](https://youtu.be/p3WS9GmfX_Q) by
4343
[Daniel Afonso](https://twitter.com/danieljcafonso)
44-
- [Testing Apollo Components Using react-testing-library](https://www.arahansen.com/testing-apollo-components-using-react-testing-library/) by [Andrew Hansen](https://twitter.com/arahansen)
44+
- [Testing Apollo Components Using react-testing-library](https://www.arahansen.com/testing-apollo-components-using-react-testing-library/)
45+
by [Andrew Hansen](https://twitter.com/arahansen)
4546

4647
## Portuguese 🇧🇷
4748

docs/queries/about.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ possible. With this in mind, we recommend this order of priority:
124124
experience of interacting with these attributes varies greatly across
125125
browsers and assistive technology.
126126
1. `getByAltText`: If your element is one which supports `alt` text (`img`,
127-
`area`, `input`, and any custom element), then you can use this to find that element.
127+
`area`, `input`, and any custom element), then you can use this to find
128+
that element.
128129
1. `getByTitle`: The title attribute is not consistently read by
129130
screenreaders, and is not visible by default for sighted users
130131
1. **Test IDs**

docs/queries/byalttext.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ getByAltText(
2323
```
2424

2525
This will return the element (normally an `<img>`) that has the given `alt`
26-
text. Note that it only supports elements which accept an `alt` attribute or [custom elements](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements) (since we don't know if a custom element implements `alt` or not):
26+
text. Note that it only supports elements which accept an `alt` attribute or
27+
[custom elements](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements)
28+
(since we don't know if a custom element implements `alt` or not):
2729
[`<img>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img),
2830
[`<input>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input),
2931
and [`<area>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/area)

docs/queries/byrole.mdx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ not replace the functionality of these attributes. For example
6464
`<img aria-label="fancy image" src="fancy.jpg" />` will be returned for both
6565
`getByAltText('fancy image')` and `getByRole('image', { name: 'fancy image' })`.
6666
However, the image will not display its description if `fancy.jpg` could not be
67-
loaded. Whether you want to assert this functionality in your test or not is up to
68-
you.
67+
loaded. Whether you want to assert this functionality in your test or not is up
68+
to you.
6969

7070
## Options
7171

@@ -146,8 +146,8 @@ state and which elements can have this state see
146146
### `current`
147147

148148
You can filter the returned elements by their current state by setting
149-
`current: boolean | string`.
150-
Note that no `aria-current` attribute will match `current: false` since `false` is the default value for `aria-current`.
149+
`current: boolean | string`. Note that no `aria-current` attribute will match
150+
`current: false` since `false` is the default value for `aria-current`.
151151

152152
For example in
153153

@@ -160,8 +160,9 @@ For example in
160160
</body>
161161
```
162162

163-
you can get the "👍" link by calling `getByRole('link', { current: true })` and the "👎" by calling `getByRole('link', { current: false })`.
164-
To learn more about the current state see
163+
you can get the "👍" link by calling `getByRole('link', { current: true })` and
164+
the "👎" by calling `getByRole('link', { current: false })`. To learn more about
165+
the current state see
165166
[ARIA `aria-current`](https://www.w3.org/TR/wai-aria-1.2/#aria-current).
166167

167168
### `pressed`

docs/react-testing-library/setup.mdx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -286,28 +286,30 @@ using Create React App without TypeScript, save this to `jsconfig.json` instead.
286286
}
287287
}
288288
```
289-
289+
290290
### Jest 27
291291

292-
If you're using a recent version of Jest (27 or later), `jsdom` is no longer the
293-
default environment. You can enable `jsdom` globally by editing `jest.config.js`:
294-
292+
If you're using a recent version of Jest (27 or later), `jsdom` is no longer the
293+
default environment. You can enable `jsdom` globally by editing
294+
`jest.config.js`:
295+
295296
```diff title="jest.config.js"
296297
module.exports = {
297298
+ testEnvironment: 'jest-environment-jsdom',
298299
// ... other options ...
299300
}
300301
```
301-
302-
Or if you only need `jsdom` in some of your tests, you can enable it as and when
303-
needed using [docblocks](https://jestjs.io/docs/configuration#testenvironment-string):
304-
305-
```js
306-
/**
307-
* @jest-environment jsdom
308-
*/
302+
303+
Or if you only need `jsdom` in some of your tests, you can enable it as and when
304+
needed using
305+
[docblocks](https://jestjs.io/docs/configuration#testenvironment-string):
306+
307+
```js
308+
/**
309+
* @jest-environment jsdom
310+
*/
309311
```
310-
312+
311313
### Jest 24 (or lower) and defaults
312314

313315
If you're using the Jest testing framework version 24 or lower with the default

docs/vue-testing-library/api.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,13 @@ This method is a shortcut for `console.log(prettyDOM(element))`.
172172
defaults to `baseElement`
173173

174174
```jsx
175-
import { render } from '@testing-library/vue'
175+
import {render} from '@testing-library/vue'
176176

177177
const HelloWorldComponent = {
178-
template: `<h1>Hello World</h1>`
178+
template: `<h1>Hello World</h1>`,
179179
}
180180

181-
const { debug } = render(HelloWorldComponent)
181+
const {debug} = render(HelloWorldComponent)
182182
debug()
183183
// <div>
184184
// <h1>Hello World</h1>

docs/vue-testing-library/faq.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ re-exports it.
3030
<details>
3131
<summary>What queries does Vue Testing Library provide?</summary>
3232

33-
All queries from DOM Testing Library. See
34-
[Queries](cheatsheet#queries) for full list.
33+
All queries from DOM Testing Library. See [Queries](cheatsheet#queries) for full
34+
list.
3535

3636
</details>
3737

0 commit comments

Comments
 (0)