Skip to content

Commit 1afa14a

Browse files
committed
feat: move node-dependent code to main package
1 parent c5b5313 commit 1afa14a

15 files changed

+40
-1667
lines changed

electron/common/__mocks__/writable.mock.ts

-64
This file was deleted.

electron/common/logger/__mocks__/log-formatter.mock.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import type { MockedFunction } from 'vitest';
22
import { vi } from 'vitest';
33
import type { LogFormatter } from '../types.js';
44

5-
export type LogFormatterMock = MockedFunction<LogFormatter>;
5+
export interface LogFormatterMock extends LogFormatter {
6+
format: MockedFunction<LogFormatter['format']>;
7+
}
68

7-
export const mockLogFormatterFactory = (): LogFormatterMock => {
8-
return vi.fn<LogFormatter>();
9-
};
9+
export class LogFormatterMockImpl implements LogFormatterMock {
10+
format = vi.fn<LogFormatter['format']>();
11+
}
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
import type { MockedFunction } from 'vitest';
2-
import { WritableMockImpl } from '../../__mocks__/writable.mock.js';
3-
import type { LogTransport } from '../types.js';
2+
import { vi } from 'vitest';
3+
import type { LogTransporter } from '../types.js';
44

5-
export interface LogTransportMock extends LogTransport {
6-
writable: boolean;
7-
write: MockedFunction<WritableMockImpl['write']>;
8-
on: MockedFunction<(...args: Parameters<WritableMockImpl['on']>) => this>;
9-
once: MockedFunction<(...args: Parameters<WritableMockImpl['once']>) => this>;
10-
off: MockedFunction<(...args: Parameters<WritableMockImpl['off']>) => this>;
11-
emit: MockedFunction<WritableMockImpl['emit']>;
5+
export interface LogTransporterMock extends LogTransporter {
6+
transport: MockedFunction<LogTransporter['transport']>;
127
}
138

14-
export class LogTransportMockImpl
15-
extends WritableMockImpl
16-
implements LogTransportMock {}
9+
export class LogTransporterMockImpl implements LogTransporterMock {
10+
transport = vi.fn<LogTransporter['transport']>();
11+
}

electron/common/logger/__tests__/logger-utils.test.ts

-274
This file was deleted.

0 commit comments

Comments
 (0)