Fix lint and jest issues

This commit is contained in:
Joshua Brooks
2026-05-20 20:18:29 +00:00
parent b9bf592b98
commit 5a912e8b4a
9 changed files with 56 additions and 61 deletions

View File

@@ -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();
}