From 4417a254895af187a1806acea786cd01493792e0 Mon Sep 17 00:00:00 2001 From: Johan Nyman Date: Wed, 17 Apr 2024 15:03:08 +0200 Subject: [PATCH] fix: remove PackageInfo when the expectation is removed --- .../genericWorker/expectationHandlers/jsonDataCopy.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shared/packages/worker/src/worker/workers/genericWorker/expectationHandlers/jsonDataCopy.ts b/shared/packages/worker/src/worker/workers/genericWorker/expectationHandlers/jsonDataCopy.ts index cb2dfae5..d72a8368 100644 --- a/shared/packages/worker/src/worker/workers/genericWorker/expectationHandlers/jsonDataCopy.ts +++ b/shared/packages/worker/src/worker/workers/genericWorker/expectationHandlers/jsonDataCopy.ts @@ -339,7 +339,11 @@ export const JsonDataCopy: ExpectationHandlerGenericWorker = { } try { - await lookupTarget.handle.removePackage('expectation removed') + if (isCorePackageInfoAccessorHandle(lookupTarget.handle)) { + await lookupTarget.handle.removePackageInfo(PackageInfoType.JSON, exp) + } else { + await lookupTarget.handle.removePackage('expectation removed') + } } catch (err) { return { removed: false,