tests - do not break codeAutomationExit API (refs microsoft/vscode-test-web#82) (#181682)

This commit is contained in:
Benjamin Pasero
2023-05-08 12:36:55 +02:00
committed by GitHub
parent 60fe2d5970
commit 3f7bc08865
3 changed files with 3 additions and 3 deletions

View File

@@ -11,7 +11,7 @@ import { AdapterLogger, DEFAULT_LOG_LEVEL, ILogger, LogLevel } from 'vs/platform
export interface IAutomatedWindow {
codeAutomationLog(type: string, args: any[]): void;
codeAutomationExit(logs: Array<ILogFile>, code: number): void;
codeAutomationExit(code: number, logs: Array<ILogFile>): void;
}
export interface ILogFile {

View File

@@ -146,7 +146,7 @@ export class ExtensionService extends AbstractExtensionService implements IExten
// If we are running extension tests, forward logs and exit code
const automatedWindow = window as unknown as IAutomatedWindow;
if (typeof automatedWindow.codeAutomationExit === 'function') {
automatedWindow.codeAutomationExit(await getLogs(this._fileService, this._environmentService), code);
automatedWindow.codeAutomationExit(code, await getLogs(this._fileService, this._environmentService));
}
}
}

View File

@@ -67,7 +67,7 @@ async function runTestsInBrowser(browserType: BrowserType, endpoint: url.UrlWith
console[type](...args);
});
await page.exposeFunction('codeAutomationExit', async (logs: Array<{ readonly relativePath: string; readonly contents: string }>, code: number) => {
await page.exposeFunction('codeAutomationExit', async (code: number, logs: Array<{ readonly relativePath: string; readonly contents: string }>) => {
try {
for (const log of logs) {
const absoluteLogsPath = path.join(logsPath, log.relativePath);