From 8a88690a20f90b49709d03437bad493f55d92b24 Mon Sep 17 00:00:00 2001 From: Sankalp Kotewar <98868223+kotewar@users.noreply.github.com> Date: Wed, 30 Nov 2022 08:38:59 +0000 Subject: [PATCH] Fixed test cases issues --- __tests__/restore.test.ts | 6 +++--- src/utils/testUtils.ts | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/__tests__/restore.test.ts b/__tests__/restore.test.ts index dba26ba..40239fb 100644 --- a/__tests__/restore.test.ts +++ b/__tests__/restore.test.ts @@ -333,7 +333,7 @@ test("restore with enabling save on any failure feature", async () => { path: path, key, restoreKeys: [restoreKey], - saveOnAnyFailure: "true" + saveOnAnyFailure: true }); const debugMock = jest.spyOn(core, "debug"); @@ -374,7 +374,7 @@ test("Fail restore when fail on cache miss is enabled and primary key not found" path: path, key, restoreKeys: [restoreKey], - strictRestore: "true" + failOnCacheMiss: true }); const failedMock = jest.spyOn(core, "setFailed"); @@ -408,7 +408,7 @@ test("Fail restore when fail on cache miss is enabled and primary key doesn't ma path: path, key, restoreKeys: [restoreKey], - strictRestore: "true" + failOnCacheMiss: true }); const failedMock = jest.spyOn(core, "setFailed"); diff --git a/src/utils/testUtils.ts b/src/utils/testUtils.ts index ec4c589..a5ee19f 100644 --- a/src/utils/testUtils.ts +++ b/src/utils/testUtils.ts @@ -13,8 +13,8 @@ interface CacheInput { path: string; key: string; restoreKeys?: string[]; - strictRestore?: string; - saveOnAnyFailure?: string; + failOnCacheMiss?: boolean; + saveOnAnyFailure?: boolean; } export function setInputs(input: CacheInput): void { @@ -24,10 +24,10 @@ export function setInputs(input: CacheInput): void { setInput(Inputs.FailOnCacheMiss, "false"); input.restoreKeys && setInput(Inputs.RestoreKeys, input.restoreKeys.join("\n")); - input.strictRestore && - setInput(Inputs.FailOnCacheMiss, input.strictRestore); + input.failOnCacheMiss && + setInput(Inputs.FailOnCacheMiss, String(input.failOnCacheMiss)); input.saveOnAnyFailure && - setInput(Inputs.SaveOnAnyFailure, input.saveOnAnyFailure); + setInput(Inputs.SaveOnAnyFailure, String(input.saveOnAnyFailure)); } export function clearInputs(): void {