-
Notifications
You must be signed in to change notification settings - Fork 32
Add unit tests for buildProfile #243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import assert from 'node:assert/strict'; | ||
| import test from 'node:test'; | ||
| import { buildProfile } from '../dist/history/store.js'; | ||
|
|
||
| const history = [ | ||
| { message: 'fix: bug' }, | ||
| { message: 'feat: feature' }, | ||
| ]; | ||
|
|
||
| test('buildProfile returns correct profile', async () => { | ||
| const profile = await buildProfile(history); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P0: The test passes an array of commit objects to This test is a no-op: it never actually exercises Prompt for AI agents |
||
| assert.ok(profile); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: The test only checks Prompt for AI agents |
||
| }); | ||
|
Comment on lines
+5
to
+13
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Assert the profile values, not only truthiness.
🤖 Prompt for AI Agents |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: 404-PF/commit-echo
Length of output: 43815
🏁 Script executed:
Repository: 404-PF/commit-echo
Length of output: 8470
Use
buildProfile’s numeric API and validate the fixture.buildProfileonly takes a numerichistorySizeand reads the configured history file. Passing thehistoryarray does not use the fixture through the exported API; this test can also assert only truthiness, so it may miss profile metric regressions. Create the test history file and callbuildProfile(history.length), or change the exported API to accept the entries.[functional_correcteness]
🤖 Prompt for AI Agents