diff --git a/test/smoke/src/main.ts b/test/smoke/src/main.ts index 700bd3831f..54d6bfa1a9 100644 --- a/test/smoke/src/main.ts +++ b/test/smoke/src/main.ts @@ -13,7 +13,7 @@ import * as mkdirp from 'mkdirp'; import { ncp } from 'ncp'; import * as vscodetest from 'vscode-test'; import fetch from 'node-fetch'; -import { Quality, ApplicationOptions, MultiLogger, Logger, ConsoleLogger, FileLogger, Application } from '../../automation'; +import { Quality, ApplicationOptions, MultiLogger, Logger, ConsoleLogger, FileLogger } from '../../automation'; import { main as sqlMain, setup as sqlSetup } from './sql/main'; // {{SQL CARBON EDIT}} /*import { setup as setupDataMigrationTests } from './areas/workbench/data-migration.test'; @@ -362,18 +362,6 @@ after(async function () { sqlMain(opts); -if (screenshotsPath) { - afterEach(async function () { - if (this.currentTest!.state !== 'failed') { - return; - } - const app = this.app as Application; - const name = this.currentTest!.fullTitle().replace(/[^a-z0-9\-]/ig, '_'); - - await app.captureScreenshot(name); - }); -} - if (!opts.web && opts['build'] && !opts['remote']) { describe(`Stable vs Insiders Smoke Tests: This test MUST run before releasing`, () => { // setupDataMigrationTests(opts, testDataPath); {{SQL CARBON EDIT}} Remove unused tests diff --git a/test/smoke/src/utils.ts b/test/smoke/src/utils.ts index 37af073b24..f3261b044c 100644 --- a/test/smoke/src/utils.ts +++ b/test/smoke/src/utils.ts @@ -43,13 +43,17 @@ export function beforeSuite(opts: minimist.ParsedArgs, optionsTransform?: (opts: } export function afterSuite(opts: minimist.ParsedArgs) { - after(async function () { + afterEach(async function () { const app = this.app as Application; if (this.currentTest?.state === 'failed' && opts.screenshots) { const name = this.currentTest!.fullTitle().replace(/[^a-z0-9\-]/ig, '_'); await app.captureScreenshot(name); } + }); + + after(async function () { + const app = this.app as Application; if (app) { await app.stop();