Skip to content

Commit 81401a1

Browse files
author
Artem
committed
fix tests
1 parent 8d71fa1 commit 81401a1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

redisinsight/api/src/modules/profiler/models/log-file.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as fs from 'fs-extra';
22
import { LogFile } from 'src/modules/profiler/models/log-file';
33
import {
4-
mockLogFile, mockProfilerAnalyticsService, mockProfilerAnalyticsEvents, mockSocket,
4+
mockLogFile, mockProfilerAnalyticsEvents, mockSocket,
55
} from 'src/__mocks__';
66
import config from 'src/utils/config';
77
import { join } from 'path';
@@ -15,7 +15,8 @@ describe('LogFile', () => {
1515
let logFile: LogFile;
1616

1717
beforeEach(() => {
18-
logFile = new LogFile(mockLogFile.instanceId, mockLogFile.id, mockProfilerAnalyticsService.getEventsEmitters());
18+
logFile = new LogFile(mockLogFile.instanceId, mockLogFile.id, mockProfilerAnalyticsEvents);
19+
jest.resetAllMocks();
1920
});
2021

2122
it('Initialization', () => {
@@ -45,7 +46,6 @@ describe('LogFile', () => {
4546
expect(stream).toBeInstanceOf(ReadStream);
4647
expect(stream.destroyed).toEqual(false);
4748
stream.emit('end');
48-
await new Promise((r) => setTimeout(r, 1000));
4949
expect(stream.destroyed).toEqual(true);
5050
expect(mockProfilerAnalyticsEvents.get(TelemetryEvents.ProfilerLogDownloaded)).toHaveBeenCalled();
5151
expect(logFile.getReadStream()).not.toEqual(stream);

0 commit comments

Comments
 (0)