Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
"zod": "^3.23.8"
},
"devDependencies": {
"@types/bun": "^1.3.13",
"@types/figlet": "^1.7.0",
"@types/node": "^25.7.0",
"@types/react": "^19.2.14",
"figlet": "^1.11.0"
}
Expand Down
14 changes: 13 additions & 1 deletion src/cli/render.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,23 @@ import { describe, it, expect, beforeEach, afterEach } from "bun:test";
import { renderPassage, renderParseError, renderRepoError } from "./render";
import type { ParseError, RepoError } from "@/domain/errors";
import type { Passage } from "@/domain/passage";
import type { Reference } from "@/domain/reference";
import { makeBookId } from "@/domain/book-id";

// --- Fixtures ---

const jhnResult = makeBookId("JHN");
if (!jhnResult.ok) throw new Error("test fixture: JHN must be a valid BookId");

const johnRef: Reference = {
book: jhnResult.value,
chapter: 3,
verses: { start: 16, end: 16 },
};

const passage: Passage = {
verses: [{ text: "For God so loved the world." }],
reference: johnRef,
verses: [{ number: 16, text: "For God so loved the world." }],
};

const PASSAGE_PLAIN = "For God so loved the world.";
Expand Down
2 changes: 1 addition & 1 deletion src/domain/book-id.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe("makeBookId", () => {
const result = makeBookId("JHN");
expect(result.ok).toBe(true);
if (!result.ok) return;
expect(result.value).toBe("JHN");
expect(result.value as string).toBe("JHN");
});

it("accepts GEN — first book in the canonical set", () => {
Expand Down
6 changes: 3 additions & 3 deletions src/domain/reference.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe("parseReference", () => {
const result = parseReference("john 3:16");
expect(result.ok).toBe(true);
if (!result.ok) return;
expect(result.value.book).toBe("JHN");
expect(result.value.book as string).toBe("JHN");
expect(result.value.chapter).toBe(3);
expect(result.value.verses).toEqual({ start: 16, end: 16 });
});
Expand All @@ -15,7 +15,7 @@ describe("parseReference", () => {
const result = parseReference("JOHN 3:16");
expect(result.ok).toBe(true);
if (!result.ok) return;
expect(result.value.book).toBe("JHN");
expect(result.value.book as string).toBe("JHN");
expect(result.value.chapter).toBe(3);
expect(result.value.verses).toEqual({ start: 16, end: 16 });
});
Expand All @@ -24,7 +24,7 @@ describe("parseReference", () => {
const result = parseReference("Jn 3:16");
expect(result.ok).toBe(true);
if (!result.ok) return;
expect(result.value.book).toBe("JHN");
expect(result.value.book as string).toBe("JHN");
});

it("returns unknown_book for 'xyzzy 99:99' — SCN-3", () => {
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"jsx": "react-jsx",
Expand Down
Loading