Skip to content

Commit

Permalink
chore(deps): update dependency eslint-plugin-jest to v24.7.0 (#734)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Sarah Dayan <[email protected]>
  • Loading branch information
renovate[bot] and sarahdayan authored Apr 7, 2023
1 parent e7c8429 commit f0c917d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 27 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"eslint-config-prettier": "6.15.0",
"eslint-plugin-eslint-comments": "3.2.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jest": "24.1.3",
"eslint-plugin-jest": "24.7.0",
"eslint-plugin-prettier": "3.4.1",
"eslint-plugin-react": "7.32.2",
"eslint-plugin-react-hooks": "4.6.0",
Expand Down
40 changes: 22 additions & 18 deletions packages/autocomplete-core/src/__tests__/getInputProps.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,29 +565,33 @@ describe('getInputProps', () => {
});
});

/* eslint-disable-next-line jest/no-done-callback */
test('lets user handle the errors', (done) => {
const getSources = jest.fn((..._args: any[]) => {
return [
createSource({
getItems() {
return new Promise<any>((resolve, reject) => {
reject(new Error('Fetch error'));
}).catch((err) => {
expect(err).toEqual(expect.any(Error));
done();
return [];
});
},
}),
];
});
test('lets user handle the errors', async () => {
const onError = jest.fn();

const { inputElement } = createPlayground(createAutocomplete, {
getSources,
getSources: jest.fn(() => {
return [
createSource({
getItems() {
return new Promise<any>((_, reject) => {
reject(new Error('Fetch error'));
}).catch((err) => {
onError(err);

return [];
});
},
}),
];
}),
});

userEvent.type(inputElement, 'a');

await runAllMicroTasks();

expect(onError).toHaveBeenCalledTimes(1);
expect(onError).toHaveBeenCalledWith(new Error('Fetch error'));
});

test('clears stalled timeout', async () => {
Expand Down
9 changes: 1 addition & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8682,14 +8682,7 @@ eslint-plugin-import@^2.22.1:
resolve "^1.20.0"
tsconfig-paths "^3.12.0"

[email protected]:
version "24.1.3"
resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-24.1.3.tgz#fa3db864f06c5623ff43485ca6c0e8fc5fe8ba0c"
integrity sha512-dNGGjzuEzCE3d5EPZQ/QGtmlMotqnYWD/QpCZ1UuZlrMAdhG5rldh0N0haCvhGnUkSeuORS5VNROwF9Hrgn3Lg==
dependencies:
"@typescript-eslint/experimental-utils" "^4.0.1"

eslint-plugin-jest@^24.1.0:
[email protected], eslint-plugin-jest@^24.1.0:
version "24.7.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-24.7.0.tgz#206ac0833841e59e375170b15f8d0955219c4889"
integrity sha512-wUxdF2bAZiYSKBclsUMrYHH6WxiBreNjyDxbRv345TIvPeoCEgPNEn3Sa+ZrSqsf1Dl9SqqSREXMHExlMMu1DA==
Expand Down

0 comments on commit f0c917d

Please sign in to comment.