From 3896095e4dcb188514d529ce3b30e585f9a333d3 Mon Sep 17 00:00:00 2001 From: Barak Date: Mon, 4 Dec 2023 12:31:33 +0200 Subject: [PATCH] fix: dispose order --- packages/test-kit/src/with-feature.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/test-kit/src/with-feature.ts b/packages/test-kit/src/with-feature.ts index d26322a84..279ebfee4 100644 --- a/packages/test-kit/src/with-feature.ts +++ b/packages/test-kit/src/with-feature.ts @@ -298,11 +298,11 @@ export function withFeature(withFeatureOptions: IWithFeatureOptions = {}): WithF }); const disposables = new Disposables(); - disposables.registerGroup(DISPOSE_OF_TEMP_DIRS, { after: 'default' }); - disposables.registerGroup(WITH_FEATURE_DISPOSABLES, { after: 'default', before: DISPOSE_OF_TEMP_DIRS }); - disposables.registerGroup(PAGE_DISPOSABLES, { before: WITH_FEATURE_DISPOSABLES }); - disposables.registerGroup(TRACING_DISPOSABLES, { before: PAGE_DISPOSABLES }); - disposables.registerGroup(FINALE, { after: PAGE_DISPOSABLES }); + disposables.registerGroup(TRACING_DISPOSABLES, { after: 'default' }); + disposables.registerGroup(PAGE_DISPOSABLES, { after: TRACING_DISPOSABLES }); + disposables.registerGroup(WITH_FEATURE_DISPOSABLES, { after: PAGE_DISPOSABLES }); + disposables.registerGroup(DISPOSE_OF_TEMP_DIRS, { after: WITH_FEATURE_DISPOSABLES }); + disposables.registerGroup(FINALE, { after: DISPOSE_OF_TEMP_DIRS }); const onDispose = (disposable: DisposableItem, options?: DisposableOptions) => disposables.add(disposable, { group: FINALE, ...options }); @@ -437,7 +437,7 @@ export function withFeature(withFeatureOptions: IWithFeatureOptions = {}): WithF await featurePage.close(); }, { - group: FINALE, + group: PAGE_DISPOSABLES, name: 'close feature page' + (takeScreenshotsOfFailed ? ' and take screenshot' : ''), timeout: 10_000, },