diff --git a/test/smoke/src/areas/workbench/data-loss.test.ts b/test/smoke/src/areas/workbench/data-loss.test.ts index df19f673914..46af836e91c 100644 --- a/test/smoke/src/areas/workbench/data-loss.test.ts +++ b/test/smoke/src/areas/workbench/data-loss.test.ts @@ -71,18 +71,18 @@ export function setup(ensureStableCode: () => string | undefined, logger: Logger }); it('verifies that "hot exit" works for dirty files (without delay)', function () { - return testHotExit.call(this, 'test_verifies_that_hot_exit_works_for_dirty_files_without_delay', undefined); + return testHotExit.call(this, 'test_verifies_that_hot_exit_works_for_dirty_files_without_delay', undefined, undefined); }); it('verifies that "hot exit" works for dirty files (with delay)', function () { - return testHotExit.call(this, 'test_verifies_that_hot_exit_works_for_dirty_files_with_delay', 2000); + return testHotExit.call(this, 'test_verifies_that_hot_exit_works_for_dirty_files_with_delay', 2000, undefined); }); it('verifies that auto save triggers on shutdown', function () { return testHotExit.call(this, 'test_verifies_that_auto_save_triggers_on_shutdown', undefined, true); }); - async function testHotExit(title: string, restartDelay: number | undefined, autoSave: boolean | undefined) { + async function testHotExit(this: import('mocha').Context, title: string, restartDelay: number | undefined, autoSave: boolean | undefined) { app = createApp({ ...this.defaultOptions, logsPath: suiteLogsPath(this.defaultOptions, title), @@ -201,7 +201,7 @@ export function setup(ensureStableCode: () => string | undefined, logger: Logger return testHotExit.call(this, `test_verifies_that_hot_exit_works_for_dirty_files_with_delay_from_stable`, 2000); }); - async function testHotExit(title: string, restartDelay: number | undefined) { + async function testHotExit(this: import('mocha').Context, title: string, restartDelay: number | undefined) { const stableCodePath = ensureStableCode(); if (!stableCodePath) { this.skip(); diff --git a/test/smoke/src/utils.ts b/test/smoke/src/utils.ts index 5bbb4d21104..3d4912658e9 100644 --- a/test/smoke/src/utils.ts +++ b/test/smoke/src/utils.ts @@ -19,25 +19,6 @@ export function itRepeat(n: number, description: string, callback: (this: Contex } } -/** - * Defines a test-case that will run but will be skips it if it throws an exception. This is useful - * to get some runs in CI when trying to stabilize a flaky test, without failing the build. Note - * that this only works if something inside the test throws, so a test's overall timeout won't work - * but throwing due to a polling timeout will. - * @param title The test-case title. - * @param callback The test-case callback. - */ -export function itSkipOnFail(title: string, callback: (this: Context) => any): void { - it(title, function () { - return Promise.resolve().then(() => { - return callback.apply(this, arguments); - }).catch(e => { - console.warn(`Test "${title}" failed but was marked as skip on fail:`, e); - this.skip(); - }); - }); -} - export function installAllHandlers(logger: Logger, optionsTransform?: (opts: ApplicationOptions) => ApplicationOptions) { installDiagnosticsHandler(logger); installAppBeforeHandler(optionsTransform); @@ -195,7 +176,7 @@ export async function retry(task: ITask>, delay: number, retries: return await task(); } catch (error) { - lastError = error; + lastError = error as Error; await timeout(delay); } diff --git a/test/smoke/tsconfig.json b/test/smoke/tsconfig.json index 6f0b40e93e5..262769765a6 100644 --- a/test/smoke/tsconfig.json +++ b/test/smoke/tsconfig.json @@ -4,14 +4,14 @@ "noImplicitAny": false, "removeComments": false, "preserveConstEnums": true, - "target": "es2017", - "strictNullChecks": true, + "target": "es2020", + "strict": true, "noUnusedParameters": false, "noUnusedLocals": true, "outDir": "out", "sourceMap": true, "lib": [ - "es2016", + "es2020", "dom" ] },