Files
vu/tests/scripture/scripture.test.ts
T
will 5ebb856de7
Deploy / deploy (push) Successful in 1m54s
Bulk-import the Vulgate/Douay-Rheims scripture text
Adds ~1017 chapter YAML files under src/data/scripture/ carrying verified
bilingual (Latin Vulgate / Douay-Rheims English) verse text, closing out
the bulk scripture import TODO.md has tracked as pending bulk-content
work. Daniel 14 (the Greek deuterocanonical addition) has no counterpart
in the Latin source and stays unauthored.

Raises the PWA precache size cap (8 -> 24 MiB) to fit the larger bundle,
repoints scripture.test.ts's "unauthored chapter" case from Genesis 1
(now authored) to Daniel 14, and adds bulk-import.test.ts asserting every
imported chapter has verified, gap-free, ordered verse text in both
languages -- tolerating the pre-existing isa-33/sir-36 pointing-split
half-verses, whose English intentionally isn't split to match.

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

28 lines
1.2 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', () => {
// Daniel 14 has no counterpart in the bulk-imported Latin source (it
// stops at 3:22, missing the deuterocanonical Greek additions) -- see
// TODO.md's bulk scripture import entry.
expect(getScriptureVerses('dan', 14)).toEqual([]);
expect(getScriptureChapter('dan', 14)).toBeUndefined();
});
});