mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 17:19:01 +01:00
smoke - improve app lifecycle (#139693)
* smoke - make sure app is closed when `app.start` fails * smoke - `capturePage` to fallback to active window * smoke - more logging around remote resolving
This commit is contained in:
@@ -88,7 +88,8 @@ export function installDiagnosticsHandler(logger: Logger, appFn?: () => Applicat
|
||||
|
||||
function installAppBeforeHandler(optionsTransform?: (opts: ApplicationOptions) => ApplicationOptions) {
|
||||
before(async function () {
|
||||
this.app = await startApp(this.defaultOptions, optionsTransform);
|
||||
this.app = createApp(this.defaultOptions, optionsTransform);
|
||||
await this.app.start();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -105,7 +106,7 @@ export function installAppAfterHandler(appFn?: () => Application | undefined, jo
|
||||
});
|
||||
}
|
||||
|
||||
export async function startApp(options: ApplicationOptions, optionsTransform?: (opts: ApplicationOptions) => ApplicationOptions): Promise<Application> {
|
||||
export function createApp(options: ApplicationOptions, optionsTransform?: (opts: ApplicationOptions) => ApplicationOptions): Application {
|
||||
if (optionsTransform) {
|
||||
options = optionsTransform({ ...options });
|
||||
}
|
||||
@@ -115,8 +116,6 @@ export async function startApp(options: ApplicationOptions, optionsTransform?: (
|
||||
userDataDir: getRandomUserDataDir(options)
|
||||
});
|
||||
|
||||
await app.start();
|
||||
|
||||
return app;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user