mirror of
https://github.com/actions/cache.git
synced 2026-05-22 21:28:19 +01:00
Fix lint and jest issues
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { jest, test, expect, beforeEach, afterEach } from "@jest/globals";
|
||||
import { afterEach, beforeEach, expect, jest, test } from "@jest/globals";
|
||||
|
||||
// Mock @actions/core
|
||||
jest.unstable_mockModule("@actions/core", () => ({
|
||||
@@ -50,13 +50,10 @@ beforeEach(() => {
|
||||
(core.getInput as jest.Mock).mockImplementation(
|
||||
(name: string, options?: { required?: boolean }) => {
|
||||
const val =
|
||||
process.env[
|
||||
`INPUT_${name.replace(/ /g, "_").toUpperCase()}`
|
||||
] || "";
|
||||
process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] ||
|
||||
"";
|
||||
if (options && options.required && !val) {
|
||||
throw new Error(
|
||||
`Input required and not supplied: ${name}`
|
||||
);
|
||||
throw new Error(`Input required and not supplied: ${name}`);
|
||||
}
|
||||
return val.trim();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user