mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-12 09:50:11 -05:00
tests - do not break codeAutomationExit API (refs microsoft/vscode-test-web#82) (#181682)
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user