Skip to content

Commit

Permalink
Revert "build(deps-dev): bump prettier from 2.8.7 to 3.0.3 (#825)" (#826
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Belco90 committed Oct 3, 2023
1 parent 9ef055d commit 7c44703
Show file tree
Hide file tree
Showing 63 changed files with 1,064 additions and 865 deletions.
1,069 changes: 634 additions & 435 deletions .all-contributorsrc

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions docs/rules/await-async-utils.md
Expand Up @@ -36,7 +36,7 @@ test('something incorrectly', async () => {
getByLabelText(container, 'username'),
getByLabelText(container, 'password'),
],
{ container },
{ container }
);

waitFor(() => {}, { timeout: 100 });
Expand All @@ -46,7 +46,7 @@ test('something incorrectly', async () => {
// wrap an async util within a function...
const makeCustomWait = () => {
return waitForElementToBeRemoved(() =>
document.querySelector('div.getOuttaHere'),
document.querySelector('div.getOuttaHere')
);
};
makeCustomWait(); // ...but not handling promise from it is incorrect
Expand All @@ -66,7 +66,7 @@ test('something correctly', async () => {
getByLabelText(container, 'username'),
getByLabelText(container, 'password'),
],
{ container },
{ container }
);

// `then` chained method is correct
Expand All @@ -77,7 +77,7 @@ test('something correctly', async () => {
// wrap an async util within a function...
const makeCustomWait = () => {
return waitForElementToBeRemoved(() =>
document.querySelector('div.getOuttaHere'),
document.querySelector('div.getOuttaHere')
);
};
await makeCustomWait(); // ...and handling promise from it is correct
Expand Down
12 changes: 6 additions & 6 deletions docs/rules/prefer-find-by.md
Expand Up @@ -18,28 +18,28 @@ Examples of **incorrect** code for this rule
```js
// arrow functions with one statement, using screen and any sync query method
const submitButton = await waitFor(() =>
screen.getByRole('button', { name: /submit/i }),
screen.getByRole('button', { name: /submit/i })
);
const submitButton = await waitFor(() =>
screen.getAllByTestId('button', { name: /submit/i }),
screen.getAllByTestId('button', { name: /submit/i })
);

// arrow functions with one statement, calling any sync query method
const submitButton = await waitFor(() =>
queryByLabel('button', { name: /submit/i }),
queryByLabel('button', { name: /submit/i })
);

const submitButton = await waitFor(() =>
queryAllByText('button', { name: /submit/i }),
queryAllByText('button', { name: /submit/i })
);

// arrow functions with one statement, calling any sync query method with presence assertion
const submitButton = await waitFor(() =>
expect(queryByLabel('button', { name: /submit/i })).toBeInTheDocument(),
expect(queryByLabel('button', { name: /submit/i })).toBeInTheDocument()
);

const submitButton = await waitFor(() =>
expect(queryByLabel('button', { name: /submit/i })).not.toBeFalsy(),
expect(queryByLabel('button', { name: /submit/i })).not.toBeFalsy()
);
```

Expand Down
2 changes: 1 addition & 1 deletion lib/configs/index.ts
Expand Up @@ -20,5 +20,5 @@ export default SUPPORTED_TESTING_FRAMEWORKS.reduce(
...allConfigs,
[framework]: getConfigForFramework(framework),
}),
{},
{}
) as Record<SupportedTestingFramework, LinterConfigRules>;

0 comments on commit 7c44703

Please sign in to comment.