Fixed test cases issues

This commit is contained in:
Sankalp Kotewar 2022-11-30 08:38:59 +00:00 committed by GitHub
parent 6e2c6a5916
commit 8a88690a20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -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");

View File

@ -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 {