init
This commit is contained in:
commit
932d4ad420
46 changed files with 5800 additions and 0 deletions
22
tests/lib/sprint.test.ts
Normal file
22
tests/lib/sprint.test.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import * as fs from "fs"
|
||||
import { describe, it, expect } from "vitest"
|
||||
import { parseSprints } from "../../lib/sprint"
|
||||
|
||||
describe("parseSprints", () => {
|
||||
it("parses compact and expanded sprint entries", () => {
|
||||
const raw = fs.readFileSync("tests/_mocks/todo-basic.txt", "utf-8")
|
||||
const sprintsText = raw.split("Content-Type: application/sprints")[1]
|
||||
const sprints = parseSprints(sprintsText)
|
||||
|
||||
expect(sprints.length).toBe(2)
|
||||
expect(sprints[0].name).toBe("Sprint Alpha")
|
||||
expect(sprints[0].start).toBe("2026-02-01")
|
||||
expect(sprints[0].end).toBe("2026-02-14")
|
||||
})
|
||||
|
||||
it("handles TODO with no sprints", () => {
|
||||
const raw = fs.readFileSync("tests/_mocks/todo-no-sprints.txt", "utf-8")
|
||||
const sprints = parseSprints(raw)
|
||||
expect(sprints.length).toBe(0)
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue