From ff5b3f784def723ba3c7575d361af4a22441d33f Mon Sep 17 00:00:00 2001 From: Minionguyjpro Date: Tue, 2 Jan 2024 20:56:56 +0100 Subject: [PATCH] Update main.test.js --- __tests__/main.test.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/__tests__/main.test.js b/__tests__/main.test.js index 5a9965f..9a732a8 100644 --- a/__tests__/main.test.js +++ b/__tests__/main.test.js @@ -1,9 +1,6 @@ const core = require("@actions/core"); -// Mocking the entire @actions/core module -jest.mock("@actions/core"); - -// Mocking specific methods +// Mocking specific methods of @actions/core core.getInput = jest.fn().mockReturnValueOnce("options").mockReturnValueOnce("path"); core.setFailed = jest.fn(); @@ -19,7 +16,7 @@ jest.mock('child_process', () => ({ }), })); -// Now, you can import and test your main.js module +// Importing the main module after the mocks are set const main = require("../src/main"); // Add your test cases here