Add back testUtilities.debug
This commit is contained in:
parent
3ff9b87a22
commit
0ab8ec34d0
4 changed files with 17 additions and 0 deletions
|
@ -2977,6 +2977,10 @@ if (isTestEnvironment(getEnvironment())) {
|
|||
event.returnValue = process.argv;
|
||||
});
|
||||
|
||||
ipc.handle('ci:test-electron:debug', async (_event, info) => {
|
||||
process.stdout.write(`ci:test-electron:debug=${JSON.stringify(info)}\n`);
|
||||
});
|
||||
|
||||
ipc.handle('ci:test-electron:event', async (_event, event) => {
|
||||
process.stdout.write(
|
||||
`ci:test-electron:event=${JSON.stringify(event)}\n`,
|
||||
|
|
|
@ -123,6 +123,14 @@ async function launchElectron(attempt: number): Promise<void> {
|
|||
|
||||
const match = line.match(/^ci:test-electron:event=(.*)/);
|
||||
if (!match) {
|
||||
const debugMatch = line.match(/ci:test-electron:debug=(.*)?/);
|
||||
if (debugMatch) {
|
||||
try {
|
||||
console.log('DEBUG:', JSON.parse(debugMatch[1]));
|
||||
} catch {
|
||||
// pass
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
1
ts/window.d.ts
vendored
1
ts/window.d.ts
vendored
|
@ -281,6 +281,7 @@ declare global {
|
|||
assert: typeof assert;
|
||||
testUtilities: {
|
||||
setup: MochaOptions;
|
||||
debug: (info: unknown) => void;
|
||||
onTestEvent: (event: unknown) => void;
|
||||
initialize: () => Promise<void>;
|
||||
prepareTests: () => void;
|
||||
|
|
|
@ -71,6 +71,10 @@ window.testUtilities = {
|
|||
return ipc.invoke('ci:test-electron:event', event);
|
||||
},
|
||||
|
||||
debug(info) {
|
||||
return ipc.invoke('ci:test-electron:debug', info);
|
||||
},
|
||||
|
||||
async initialize() {
|
||||
initMessageCleanup();
|
||||
await initializeMessageCounter();
|
||||
|
|
Loading…
Reference in a new issue