mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 17:19:01 +01:00
smoke - properly create screenshots and stop instances (#137220)
This commit is contained in:
@@ -42,9 +42,9 @@ export function beforeSuite(opts: minimist.ParsedArgs, optionsTransform?: (opts:
|
||||
});
|
||||
}
|
||||
|
||||
export function afterSuite(opts: minimist.ParsedArgs) {
|
||||
export function afterSuite(opts: minimist.ParsedArgs, appFn?: () => Application | undefined, joinFn?: () => Promise<unknown>) {
|
||||
after(async function () {
|
||||
const app = this.app as Application;
|
||||
const app: Application = appFn?.() ?? this.app;
|
||||
|
||||
if (this.currentTest?.state === 'failed' && opts.screenshots) {
|
||||
const name = this.currentTest!.fullTitle().replace(/[^a-z0-9\-]/ig, '_');
|
||||
@@ -58,6 +58,10 @@ export function afterSuite(opts: minimist.ParsedArgs) {
|
||||
if (app) {
|
||||
await app.stop();
|
||||
}
|
||||
|
||||
if (joinFn) {
|
||||
await joinFn();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user