UNPKG

mg-bibles

Version:

A package for accessing Bible verses in Malagasy (MG), Diem, King James (KJV), and Louis Segond (APEE) versions

58 lines (57 loc) 3.19 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const index_1 = require("../index"); describe('KJV Bible Version Tests', () => { describe('getVerses', () => { it('should get a single verse using full book name', () => { const result = (0, index_1.getVerses)('kjv', 'genesis 1:1'); expect(result.reference).toBe('genesis 1:1'); expect(result.verses['1']).toBe('1. In the beginning God created the heaven and the earth.'); }); it('should get verses from numbered books using full name', () => { const result = (0, index_1.getVerses)('kjv', '1 corinthians 2:4'); expect(result.reference).toBe('1 corinthians 2:4'); expect(result.verses['4']).toContain('And my speech and my preaching'); }); it('should get a verse range', () => { const result = (0, index_1.getVerses)('kjv', 'genesis 1:1-2'); expect(result.reference).toBe('genesis 1:1-2'); expect(result.verses['1']).toBe('1. In the beginning God created the heaven and the earth.'); expect(result.verses['2']).toBe('2. And the earth was without form, and void; and darkness {was} upon the face of the deep. And the Spirit of God moved upon the face of the waters.'); }); it('should get multiple verses', () => { const result = (0, index_1.getVerses)('kjv', 'genesis 1:1,3'); expect(result.reference).toBe('genesis 1:1,3'); expect(result.verses['1']).toBe('1. In the beginning God created the heaven and the earth.'); expect(result.verses['3']).toBe('3. And God said, Let there be light: and there was light.'); }); it('should get an entire chapter', () => { const result = (0, index_1.getVerses)('kjv', 'genesis 1'); expect(result.reference).toBe('genesis 1'); expect(Object.keys(result.verses).length).toBeGreaterThan(0); expect(result.verses['1']).toBe('1. In the beginning God created the heaven and the earth.'); }); }); describe('listBooks', () => { it('should list all books', () => { const books = (0, index_1.listBooks)('kjv'); expect(books).toBeDefined(); expect(Array.isArray(books)).toBe(true); expect(books.length).toBeGreaterThan(0); expect(books).toContain('genesis'); expect(books).toContain('john'); }); }); describe('Verse Counting', () => { it('should count verses in Genesis', () => { expect((0, index_1.countVerses)('kjv', 'genesis')).toBeGreaterThan(0); expect((0, index_1.chapterCount)('kjv', 'genesis')).toBeGreaterThan(0); expect((0, index_1.versesCount)('kjv', 'genesis', 1)).toBeGreaterThan(0); }); it('should count verses in Psalms', () => { expect((0, index_1.countVerses)('kjv', 'psalms')).toBeGreaterThan(0); expect((0, index_1.chapterCount)('kjv', 'psalms')).toBeGreaterThan(0); expect((0, index_1.versesCount)('kjv', 'psalms', 119)).toBeGreaterThan(0); }); }); });