|
1 | | -import { jest, test, expect, beforeEach, afterEach } from "@jest/globals"; |
| 1 | +import { afterEach, beforeEach, expect, jest, test } from "@jest/globals"; |
2 | 2 |
|
3 | 3 | // Mock @actions/core |
4 | 4 | jest.unstable_mockModule("@actions/core", () => ({ |
@@ -51,13 +51,10 @@ beforeEach(() => { |
51 | 51 | (core.getInput as jest.Mock).mockImplementation( |
52 | 52 | (name: string, options?: { required?: boolean }) => { |
53 | 53 | const val = |
54 | | - process.env[ |
55 | | - `INPUT_${name.replace(/ /g, "_").toUpperCase()}` |
56 | | - ] || ""; |
| 54 | + process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || |
| 55 | + ""; |
57 | 56 | if (options && options.required && !val) { |
58 | | - throw new Error( |
59 | | - `Input required and not supplied: ${name}` |
60 | | - ); |
| 57 | + throw new Error(`Input required and not supplied: ${name}`); |
61 | 58 | } |
62 | 59 | return val.trim(); |
63 | 60 | } |
@@ -182,7 +179,9 @@ test("restore with large key should fail", async () => { |
182 | 179 | enableCrossOsArchive: false |
183 | 180 | }); |
184 | 181 | (cache.restoreCache as jest.Mock).mockRejectedValue( |
185 | | - new Error(`Key Validation Error: ${key} cannot be larger than 512 characters.`) |
| 182 | + new Error( |
| 183 | + `Key Validation Error: ${key} cannot be larger than 512 characters.` |
| 184 | + ) |
186 | 185 | ); |
187 | 186 | await restoreImpl(new StateProvider()); |
188 | 187 | expect(cache.restoreCache).toHaveBeenCalledTimes(1); |
@@ -336,7 +335,10 @@ test("restore with lookup-only set", async () => { |
336 | 335 |
|
337 | 336 | test("restore failure with earlyExit should call process exit", async () => { |
338 | 337 | testUtils.setInput(Inputs.Path, "node_modules"); |
339 | | - const processExitMock = jest.spyOn(process, "exit").mockImplementation((() => {}) as any); |
| 338 | + const processExitMock = jest |
| 339 | + .spyOn(process, "exit") |
| 340 | + // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 341 | + .mockImplementation((() => {}) as any); |
340 | 342 |
|
341 | 343 | await restoreImpl(new StateProvider(), true); |
342 | 344 |
|
|
0 commit comments