Refactor infra tests, clean E2E step suites, and fix TS in tests
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
import { ElectronApplication } from '@playwright/test';
|
||||
|
||||
type IpcHandlerResult = {
|
||||
error?: string;
|
||||
[key: string]: unknown;
|
||||
};
|
||||
|
||||
export interface IPCTestResult {
|
||||
channel: string;
|
||||
success: boolean;
|
||||
@@ -41,10 +46,12 @@ export class IPCVerifier {
|
||||
});
|
||||
});
|
||||
|
||||
const typed: IpcHandlerResult = result as IpcHandlerResult;
|
||||
|
||||
return {
|
||||
channel,
|
||||
success: !result.error,
|
||||
error: result.error,
|
||||
success: !typed.error,
|
||||
error: typed.error,
|
||||
duration: Date.now() - start,
|
||||
};
|
||||
} catch (error) {
|
||||
@@ -79,10 +86,12 @@ export class IPCVerifier {
|
||||
});
|
||||
});
|
||||
|
||||
const typed: IpcHandlerResult = result as IpcHandlerResult;
|
||||
|
||||
return {
|
||||
channel,
|
||||
success: (result && !result.error) || typeof result === 'object',
|
||||
error: result && result.error,
|
||||
success: !typed.error,
|
||||
error: typed.error,
|
||||
duration: Date.now() - start,
|
||||
};
|
||||
} catch (error) {
|
||||
@@ -118,10 +127,12 @@ export class IPCVerifier {
|
||||
});
|
||||
});
|
||||
|
||||
const typed: IpcHandlerResult = result as IpcHandlerResult;
|
||||
|
||||
return {
|
||||
channel,
|
||||
success: !result.error,
|
||||
error: result.error,
|
||||
success: !typed.error,
|
||||
error: typed.error,
|
||||
duration: Date.now() - start,
|
||||
};
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user