Skip to content

Commit f08933c

Browse files
run format
1 parent 84a2090 commit f08933c

File tree

4 files changed

+17
-20
lines changed

4 files changed

+17
-20
lines changed

docs/rules/await-async-utils.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ test('something correctly', async () => {
9292

9393
// Using jest-extended a toResolve/toReject matcher is also correct
9494
expect(waitFor(() => getByLabelText('email'))).toResolve();
95-
9695
});
9796
```
9897

docs/rules/await-fire-event.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ The promise will be considered as handled when:
1616
- chaining `toResolve()` or `toReject()` from [jest-extended](https://github.com/jest-community/jest-extended#promise)
1717
- it's returned from a function (in this case, that particular function will be analyzed by this rule too)
1818

19-
2019
> ⚠️ `fireEvent` methods are async only on following Testing Library packages:
2120
>
2221
> - `@testing-library/vue` (supported by this plugin)
@@ -65,12 +64,11 @@ await Promise.all([
6564
fireEvent.blur(getByLabelText('username')),
6665
]);
6766

67+
// Using jest resolves or rejects
68+
expect(fireEvent.focus(getByLabelText('username'))).resolves.toBeUndefined();
6869

69-
// Using jest resolves or rejects
70-
expect(fireEvent.focus(getByLabelText('username'))).resolves.toBeUndefined();
71-
72-
// Using jest-extended a toResolve/toReject matcher is also correct
73-
expect(waitFor(() => getByLabelText('email'))).toResolve();
70+
// Using jest-extended a toResolve/toReject matcher is also correct
71+
expect(waitFor(() => getByLabelText('email'))).toResolve();
7472
```
7573

7674
## When Not To Use It

lib/node-utils/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,10 @@ export function getAssertNodeInfo(
464464
}
465465

466466
const matcherNamesHandlePromise = [
467-
'resolves',
468-
'rejects',
469-
'toResolve',
470-
'toReject',
467+
'resolves',
468+
'rejects',
469+
'toResolve',
470+
'toReject',
471471
];
472472

473473
/**

tests/lib/rules/await-async-query.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -221,14 +221,14 @@ ruleTester.run(RULE_NAME, rule, {
221221
expect(${query}("foo")).resolves.toBe("bar")
222222
expect(wrappedQuery(${query}("foo"))).resolves.toBe("bar")
223223
`
224-
),
225-
// async queries with toResolve matchers are valid
226-
...createTestCase(
227-
(query) => `
224+
),
225+
// async queries with toResolve matchers are valid
226+
...createTestCase(
227+
(query) => `
228228
expect(${query}("foo")).toResolve()
229229
expect(wrappedQuery(${query}("foo"))).toResolve()
230230
`
231-
),
231+
),
232232

233233
// async queries with rejects matchers are valid
234234
...createTestCase(
@@ -238,13 +238,13 @@ ruleTester.run(RULE_NAME, rule, {
238238
`
239239
),
240240

241-
// async queries with toReject matchers are valid
242-
...createTestCase(
243-
(query) => `
241+
// async queries with toReject matchers are valid
242+
...createTestCase(
243+
(query) => `
244244
expect(${query}("foo")).toReject()
245245
expect(wrappedQuery(${query}("foo"))).toReject()
246246
`
247-
),
247+
),
248248

249249
// unresolved async queries with aggressive reporting opted-out are valid
250250
...ALL_ASYNC_COMBINATIONS_TO_TEST.map((query) => ({

0 commit comments

Comments
 (0)