1
0
mirror of https://github.com/Minionguyjpro/Inno-Setup-Action synced 2026-02-18 17:41:18 +01:00
Files
inno-setup/__tests__/main.test.js
2024-01-02 20:56:56 +01:00

23 lines
612 B
JavaScript

const core = require("@actions/core");
// Mocking specific methods of @actions/core
core.getInput = jest.fn().mockReturnValueOnce("options").mockReturnValueOnce("path");
core.setFailed = jest.fn();
jest.mock("fs", () => ({
existsSync: jest.fn(() => true),
readdirSync: jest.fn(() => ['file1', 'file2']),
}));
jest.mock('child_process', () => ({
exec: jest.fn((command, options, callback) => {
// Simulate a successful execution
callback(null, 'stdout', 'stderr');
}),
}));
// Importing the main module after the mocks are set
const main = require("../src/main");
// Add your test cases here