diff options
author | Mathieu Suen <mathieu.suen@sonarsource.com> | 2022-02-21 11:50:32 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-03-07 20:02:55 +0000 |
commit | b90268c5cd663d677a4f0254c919e34cba67de5a (patch) | |
tree | 9cc743601a89f0eba9b3f1be6201a6de22483259 /server/sonar-web/src/main/js/apps/projectDump | |
parent | b355fc7b76a3e4949e25d7974c945d20545678fa (diff) | |
download | sonarqube-b90268c5cd663d677a4f0254c919e34cba67de5a.tar.gz sonarqube-b90268c5cd663d677a4f0254c919e34cba67de5a.zip |
[NO JIRA] Restore fake timer in UT
Diffstat (limited to 'server/sonar-web/src/main/js/apps/projectDump')
-rw-r--r-- | server/sonar-web/src/main/js/apps/projectDump/__tests__/ProjectDumpApp-test.tsx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/server/sonar-web/src/main/js/apps/projectDump/__tests__/ProjectDumpApp-test.tsx b/server/sonar-web/src/main/js/apps/projectDump/__tests__/ProjectDumpApp-test.tsx index 1a3bda61f13..928cf3dd6ff 100644 --- a/server/sonar-web/src/main/js/apps/projectDump/__tests__/ProjectDumpApp-test.tsx +++ b/server/sonar-web/src/main/js/apps/projectDump/__tests__/ProjectDumpApp-test.tsx @@ -36,9 +36,15 @@ jest.mock('../../../api/project-dump', () => ({ })); beforeEach(() => { + jest.useFakeTimers(); jest.clearAllMocks(); }); +afterEach(() => { + jest.runOnlyPendingTimers(); + jest.useRealTimers(); +}); + it('should render correctly', async () => { (getActivity as jest.Mock) .mockResolvedValueOnce({ tasks: [mockDumpTask()] }) @@ -58,8 +64,6 @@ it('should render correctly', async () => { }); it('should poll for task status update', async () => { - jest.useFakeTimers(); - const wrapper = shallowRender(); await waitAndUpdate(wrapper); |