MCPcopy Create free account
hub / github.com/driangle/taskmd / TestCommitMsg_AutoInferFromDiff

Function TestCommitMsg_AutoInferFromDiff

apps/cli/internal/cli/commit_msg_test.go:440–461  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

438}
439
440func TestCommitMsg_AutoInferFromDiff(t *testing.T) {
441 tmpDir := createCommitMsgTestFiles(t)
442 resetCommitMsgFlags()
443 taskDir = tmpDir
444
445 mockGitDiffAndRoot(t,
446 "diff --git a/cli/042-feature.md b/cli/042-feature.md\n"+
447 "+++ b/cli/042-feature.md\n"+
448 "@@ -4 +4 @@\n"+
449 "-status: pending\n"+
450 "+status: completed\n",
451 tmpDir)
452
453 output, err := captureCommitMsgOutput(t)
454 if err != nil {
455 t.Fatalf("unexpected error: %v", err)
456 }
457
458 if !strings.Contains(output, "chore(cli): add commit-msg command (task 042)") {
459 t.Errorf("expected auto-detected task message with ID in header, got:\n%s", output)
460 }
461}
462
463func TestCommitMsg_EmptyDiff(t *testing.T) {
464 tmpDir := createCommitMsgTestFiles(t)

Callers

nothing calls this directly

Calls 4

createCommitMsgTestFilesFunction · 0.85
resetCommitMsgFlagsFunction · 0.85
mockGitDiffAndRootFunction · 0.85
captureCommitMsgOutputFunction · 0.85

Tested by

no test coverage detected