Files
vu/tests/scripture/scripture.test.ts
will b29ce0551f
Deploy / deploy (push) Successful in 1m53s
Re-source the corrupted/missing scripture chapters from drbo.org
The "Unbound Bible" source used for the previous pass had real defects
in 12 chapters (Douay-Rheims verses shifted/merged under the wrong
number, e.g. "Isaias 25:1" actually holding 25:11's text) and was
missing Daniel 4-14/Esther 11-16 outright.

Found a better source: drbo.org's combined "DR + LV" page per chapter
keeps each verse's Latin and English in the same HTML block, making
the earlier misalignment structurally impossible. Fetched and parsed
all 28 real chapters from it (bar-2; isa-5/25; joan-15; rom-9/11;
sir-10/19/23/41/51; dan-4..14; esth-11..16), spot-checked several
against known-correct text, and confirmed sir-52 isn't a real chapter
at all (Sirach only has 51 -- the old source's "52" was bogus).

Store now at 1185 chapter files with zero remaining gaps against every
book/chapter citation the app actually uses. Repoints
scripture.test.ts's "unauthored chapter" case from dan-14 (now
authored) to gen-51 (Genesis only has 50 chapters).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Je2mXNHoXmi1DS3xEL67rH
2026-09-03 06:41:17 -04:00

28 lines
1.1 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { getScriptureChapter, getScriptureVerses } from '../../src/scripture';
describe('getScriptureVerses', () => {
it('resolves a verse range within an authored chapter', () => {
const verses = getScriptureVerses('ezek', 1, '4-6');
expect(verses.map((v) => v.n)).toEqual([4, 5, 6]);
expect(verses[0]?.text.la).toContain('túrbinis');
});
it('resolves the whole chapter when no range is given', () => {
expect(getScriptureVerses('ezek', 1).length).toBe(9);
});
it('includes a verse that appears twice in the source at the same number (a real Vulgate numbering quirk, not a bug)', () => {
const verses = getScriptureVerses('sap', 4, '13-16');
expect(verses.filter((v) => v.n === 14).length).toBe(2);
});
it('is empty, not throwing, for an unauthored book/chapter', () => {
// Genesis only has 50 chapters -- a chapter number past a book's own
// end is a real "doesn't exist" case, same code path as a genuinely
// unauthored one.
expect(getScriptureVerses('gen', 51)).toEqual([]);
expect(getScriptureChapter('gen', 51)).toBeUndefined();
});
});