You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
modules/git-config/main.test.ts

42 lines
1.2 KiB
TypeScript

import { describe, expect, it } from "bun:test";
import {
executeScriptInContainer,
runTerraformApply,
runTerraformInit,
testRequiredVariables,
} from "../test";
describe("git-config", async () => {
await runTerraformInit(import.meta.dir);
testRequiredVariables(import.meta.dir, {
agent_id: "foo",
allow_username_change: true,
allow_email_change: false,
});
it("fails without git", async () => {
const state = await runTerraformApply(import.meta.dir, {
agent_id: "foo",
allow_username_change: true,
allow_email_change: false,
});
const output = await executeScriptInContainer(state, "alpine");
expect(output.exitCode).toBe(1);
expect(output.stdout).toEqual(["\u001B[0;1mChecking git-config!", "Git is not installed!"]);
});
// it("runs with git", async () => {
// const state = await runTerraformApply(import.meta.dir, {
// agent_id: "foo",
// url: "fake-url",
// });
// const output = await executeScriptInContainer(state, "alpine/git");
// expect(output.exitCode).toBe(128);
// expect(output.stdout).toEqual([
// "Creating directory ~/fake-url...",
// "Cloning fake-url to ~/fake-url...",
// ]);
// });
});