mirror of
https://github.com/kiegroup/git-backporting.git
synced 2025-04-23 20:10:49 +00:00
17 lines
No EOL
463 B
TypeScript
17 lines
No EOL
463 B
TypeScript
import * as core from "@actions/core";
|
|
|
|
export const addProcessArgs = (args: string[]) => {
|
|
process.argv = [...process.argv, ...args];
|
|
};
|
|
|
|
export const resetProcessArgs = () => {
|
|
process.argv = ["node", "backporting"];
|
|
};
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
export const spyGetInput = (obj: any) => {
|
|
const mock = jest.spyOn(core, "getInput");
|
|
mock.mockImplementation((name: string) : string => {
|
|
return obj[name];
|
|
});
|
|
}; |