mirror of
https://github.com/actions/cache.git
synced 2026-06-06 17:14:21 +00:00
Fix lint and jest issues
This commit is contained in:
parent
b9bf592b98
commit
5a912e8b4a
9 changed files with 56 additions and 61 deletions
|
|
@ -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", () => ({
|
||||
|
|
@ -51,13 +51,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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue