Skip to content

Commit 90f236f

Browse files
committed
feat: **Review and commit** the metrics-reset implementation with atomic commits
1 parent ba4ab29 commit 90f236f

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

tests/cli.test.ts

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,4 +177,80 @@ describe("parseCli", () => {
177177
expect(result.hint).toBeUndefined()
178178
})
179179
})
180+
181+
describe("status option", () => {
182+
test("parses --status flag", () => {
183+
const result = parseCli(argv("--status"))
184+
185+
expect(result.options.status).toBe(true)
186+
})
187+
188+
test("parses --status with project option", () => {
189+
const result = parseCli(argv("--status", "-p", "./myproject"))
190+
191+
expect(result.options.status).toBe(true)
192+
expect(result.options.project).toBe("./myproject")
193+
})
194+
195+
test("status is undefined when not provided", () => {
196+
const result = parseCli(argv("-m", "anthropic/claude-sonnet-4"))
197+
198+
expect(result.options.status).toBeUndefined()
199+
})
200+
})
201+
202+
describe("metrics-reset option", () => {
203+
test("parses --metrics-reset flag", () => {
204+
const result = parseCli(argv("--metrics-reset"))
205+
206+
expect(result.options.metricsReset).toBe(true)
207+
})
208+
209+
test("parses --metrics-reset with project option", () => {
210+
const result = parseCli(argv("--metrics-reset", "-p", "./myproject"))
211+
212+
expect(result.options.metricsReset).toBe(true)
213+
expect(result.options.project).toBe("./myproject")
214+
})
215+
216+
test("metricsReset is undefined when not provided", () => {
217+
const result = parseCli(argv("-m", "anthropic/claude-sonnet-4"))
218+
219+
expect(result.options.metricsReset).toBeUndefined()
220+
})
221+
})
222+
223+
describe("git options", () => {
224+
test("parses --no-auto-commit flag", () => {
225+
const result = parseCli(argv("--no-auto-commit"))
226+
227+
expect(result.options.autoCommit).toBe(false)
228+
})
229+
230+
test("parses --no-auto-push flag", () => {
231+
const result = parseCli(argv("--no-auto-push"))
232+
233+
expect(result.options.autoPush).toBe(false)
234+
})
235+
236+
test("parses -s/--signoff flag", () => {
237+
const result = parseCli(argv("-s"))
238+
239+
expect(result.options.commitSignoff).toBe(true)
240+
})
241+
242+
test("parses --signoff flag", () => {
243+
const result = parseCli(argv("--signoff"))
244+
245+
expect(result.options.commitSignoff).toBe(true)
246+
})
247+
248+
test("parses all git options together", () => {
249+
const result = parseCli(argv("--no-auto-commit", "--no-auto-push", "-s"))
250+
251+
expect(result.options.autoCommit).toBe(false)
252+
expect(result.options.autoPush).toBe(false)
253+
expect(result.options.commitSignoff).toBe(true)
254+
})
255+
})
180256
})

0 commit comments

Comments
 (0)