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;
|
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) => {
|
ipc.handle('ci:test-electron:event', async (_event, event) => {
|
||||||
process.stdout.write(
|
process.stdout.write(
|
||||||
`ci:test-electron:event=${JSON.stringify(event)}\n`,
|
`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=(.*)/);
|
const match = line.match(/^ci:test-electron:event=(.*)/);
|
||||||
if (!match) {
|
if (!match) {
|
||||||
|
const debugMatch = line.match(/ci:test-electron:debug=(.*)?/);
|
||||||
|
if (debugMatch) {
|
||||||
|
try {
|
||||||
|
console.log('DEBUG:', JSON.parse(debugMatch[1]));
|
||||||
|
} catch {
|
||||||
|
// pass
|
||||||
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
1
ts/window.d.ts
vendored
1
ts/window.d.ts
vendored
|
@ -281,6 +281,7 @@ declare global {
|
||||||
assert: typeof assert;
|
assert: typeof assert;
|
||||||
testUtilities: {
|
testUtilities: {
|
||||||
setup: MochaOptions;
|
setup: MochaOptions;
|
||||||
|
debug: (info: unknown) => void;
|
||||||
onTestEvent: (event: unknown) => void;
|
onTestEvent: (event: unknown) => void;
|
||||||
initialize: () => Promise<void>;
|
initialize: () => Promise<void>;
|
||||||
prepareTests: () => void;
|
prepareTests: () => void;
|
||||||
|
|
|
@ -71,6 +71,10 @@ window.testUtilities = {
|
||||||
return ipc.invoke('ci:test-electron:event', event);
|
return ipc.invoke('ci:test-electron:event', event);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
debug(info) {
|
||||||
|
return ipc.invoke('ci:test-electron:debug', info);
|
||||||
|
},
|
||||||
|
|
||||||
async initialize() {
|
async initialize() {
|
||||||
initMessageCleanup();
|
initMessageCleanup();
|
||||||
await initializeMessageCounter();
|
await initializeMessageCounter();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue