dynamicbible/DynamicBibleIonic/src/Reference.spec.ts

38 lines
1.3 KiB
TypeScript
Raw Normal View History

import { Reference } from './Reference';
describe('Reference', () => {
it('Should parse the reference: Gen 1:1', () => {
let ref = new Reference("Gen 1:1").toString();
expect(ref).toBe('Genesis 1:1');
});
it('Should parse the reference: Gen 1:1-11', () => {
let ref = new Reference("Gen 1:1-11").toString();
expect(ref).toBe('Genesis 1:1 - 11');
});
it('Should parse the reference: Gen 1-2', () => {
let ref = new Reference("Gen 1-2").toString();
expect(ref).toBe('Genesis 1:1 - 2:*');
});
it('Should parse the reference: John 3:16', () => {
let ref = new Reference("John 3:16").toString();
expect(ref).toBe('John 3:16');
});
it('Should parse the reference: John 3-6', () => {
let ref = new Reference("Jn 3-6").toString();
expect(ref).toBe('John 3:1 - 6:*');
});
it('Should parse the reference: 1 Corinthians 3:5-6:5', () => {
let ref = new Reference("1 Corinthians 3:5-6:5").toString();
expect(ref).toBe('1 Corinthians 3:5 - 6:5');
});
it('Should parse the reference: 2 Samuel 5:5-6:5', () => {
expect(new Reference("II sam 5:5-6:5").toString()).toBe('2 Samuel 5:5 - 6:5');
});
});