Skip to content

Commit f409a7f

Browse files
committed
test: update parseCommitData tests to match new format
- tests now use hash|author|email|date|message format - aligns with fix for commit message extraction
1 parent a53c07e commit f409a7f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/git-metrics.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ describe('parseCommitData', () => {
102102
});
103103

104104
it('should parse file changes correctly', () => {
105-
const sampleOutput = `2025-11-21|abc123
105+
const sampleOutput = `abc123|John Doe|john@example.com|2025-11-21|Initial commit
106106
1\t2\tfile1.txt
107107
3\t4\tfile2.txt
108-
2025-11-20|def456
108+
def456|Jane Doe|jane@example.com|2025-11-20|Fix bug
109109
5\t6\tfile3.txt`;
110110

111111
const commits = parseCommitData(sampleOutput);
@@ -118,8 +118,8 @@ describe('parseCommitData', () => {
118118
});
119119

120120
it('should handle commits without files', () => {
121-
const sampleOutput = `2025-11-21|abc123
122-
2025-11-20|def456`;
121+
const sampleOutput = `abc123|John Doe|john@example.com|2025-11-21|Initial commit
122+
def456|Jane Doe|jane@example.com|2025-11-20|Fix bug`;
123123

124124
const commits = parseCommitData(sampleOutput);
125125
expect(commits).toHaveLength(2);

0 commit comments

Comments
 (0)