Skip to content

Commit

Permalink
test(ci): test
Browse files Browse the repository at this point in the history
  • Loading branch information
zxf4399 committed Mar 25, 2023
1 parent 44f6870 commit 88198e7
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions __tests__/clone.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,28 @@ describe("clone command", () => {
test("The Git user config is set correctly when the Git repository is successfully cloned.", async () => {
await runCloneCommand(MGRE_GIT_REPO_URL)

await execa("cd", "~")

await execa("cd", [MGRE_REPO_LOCAL_PATH])

const codebase = mgreConfig.get(MGRE_CONIFG_FIELDS.CODEBASES)?.[
"github.com"
]

if (codebase?.name && codebase?.email) {
const { stdout: username } = await execa("git", [
"config",
"user.name",
])
const { stdout: username } = await execa(
"git",
["config", "user.name"],
{
cwd: MGRE_REPO_LOCAL_PATH,
}
)

expect(username).toBe(codebase.name)

const { stdout: useremail } = await execa("git", [
"config",
"user.email",
])
const { stdout: useremail } = await execa(
"git",
["config", "user.email"],
{
cwd: MGRE_REPO_LOCAL_PATH,
}
)

expect(useremail).toBe(codebase.email)
}
Expand Down

0 comments on commit 88198e7

Please sign in to comment.