mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
71b19fd2fb
* Corrects exporting * README Changes * Forgot the compiled code. * Configuration changes * Moving action package * Update README.md * Update README.md * Improving example * Update README.md * Update src/lib.ts Co-Authored-By: XAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com> * Correctly building types * Update README.md * Configuration update * Update README.md * Re-assigning * Missing chnage * More changes * Some more information * Setting changes to repositoryPath and tokenType * Compiling * Update package.json * Token hiding * Package Exporting Changes (#185) * Initiial Changes * Changes to action * Compiled * Added better logging for when debug is off... * Removing base branch logging as it's not really required * throw new Error -> throw * Debug flag as an variable * Update README.md * More README Changes * Update README.md * Update README.md * Update README.md * error.message * Fixes the debug flag * Changing the directory routing for shell scripting * Tidying! * Changing to const * Promotion Co-authored-by: XAMPPRocky <4464295+XAMPPRocky@users.noreply.github.com>
37 lines
861 B
TypeScript
37 lines
861 B
TypeScript
import { execute, stdout } from "../src/execute";
|
|
import { exec } from "@actions/exec";
|
|
|
|
jest.mock("@actions/exec", () => ({
|
|
exec: jest.fn()
|
|
}));
|
|
|
|
describe("execute", () => {
|
|
it("should be called with the correct arguments", async () => {
|
|
await stdout("hello");
|
|
await execute("echo Montezuma", "./");
|
|
|
|
expect(exec).toBeCalledWith("echo Montezuma", [], {
|
|
cwd: "./",
|
|
silent: true,
|
|
listeners: {
|
|
stdout: expect.any(Function)
|
|
}
|
|
});
|
|
});
|
|
|
|
it("should not silence the input when INPUT_DEBUG is defined", async () => {
|
|
process.env["DEBUG_DEPLOY_ACTION"] = "yes";
|
|
|
|
await stdout("hello");
|
|
await execute("echo Montezuma", "./");
|
|
|
|
expect(exec).toBeCalledWith("echo Montezuma", [], {
|
|
cwd: "./",
|
|
silent: false,
|
|
listeners: {
|
|
stdout: expect.any(Function)
|
|
}
|
|
});
|
|
});
|
|
});
|