Skip to content

Commit

Permalink
chore(deps): update dependency jest to v27 (#164)
Browse files Browse the repository at this point in the history
* chore(deps): update dependency jest to v27

* chore(deps): update ts-jest to v27.0.3

* chore(jest): set `jsdom` as `testEnvironment` in config

* test: do not use `done()` callback (jestjs/jest#10529)

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Pablo Vinícius <62220882+pablo1v@users.noreply.github.com>
  • Loading branch information
3 people committed Jul 1, 2021
1 parent 8a1ce03 commit 53ae155
Show file tree
Hide file tree
Showing 4 changed files with 779 additions and 514 deletions.
1 change: 1 addition & 0 deletions jest.config.js
Expand Up @@ -16,6 +16,7 @@ module.exports = {
bail: true,
clearMocks: true,
collectCoverage: true,
testEnvironment: 'jsdom',
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -66,7 +66,7 @@
"eslint-plugin-react": "7.24.0",
"eslint-plugin-react-hooks": "4.2.0",
"eslint-plugin-testing-library": "4.6.0",
"jest": "26.6.3",
"jest": "27.0.6",
"lerna": "4.0.0",
"node-env-run": "4.0.2",
"npm-run-all": "4.1.5",
Expand All @@ -76,7 +76,7 @@
"react-test-renderer": "17.0.2",
"rimraf": "3.0.2",
"semantic-release": "17.4.4",
"ts-jest": "26.5.6",
"ts-jest": "^27.0.3",
"tsc-alias": "1.3.3",
"typescript": "4.3.4"
}
Expand Down
7 changes: 4 additions & 3 deletions reactools/__tests__/hooks/useForceUpdate.test.ts
Expand Up @@ -4,18 +4,19 @@ import { act } from 'react-test-renderer';
import { useForceUpdate } from '@/hooks/useForceUpdate';

describe('useForceUpdate', () => {
it('should value must always be updated', async done => {
it('should value must always be updated', async () => {
const { result: forceUpdate, waitForNextUpdate } = renderHook(() =>
useForceUpdate(),
);

await expect(waitForNextUpdate()).rejects.toEqual(expect.anything());

act(() => {
setTimeout(() => {
forceUpdate.current();
}, 500);
});

await waitForNextUpdate();
done();
await expect(waitForNextUpdate()).resolves.toBe(undefined);
});
});

0 comments on commit 53ae155

Please sign in to comment.