-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include alt Triennial Haftara in CSV
- Loading branch information
Showing
9 changed files
with
153 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import test from 'ava'; | ||
import triennialHaft from './triennial-haft.json'; | ||
import numverses from './numverses.json'; | ||
|
||
// eslint-disable-next-line require-jsdoc | ||
function testAliyah(t, name, haft) { | ||
if (typeof haft === 'undefined') { | ||
t.fail(`${name} => <undefined>`); | ||
} | ||
if (Array.isArray(haft)) { | ||
for (const aliyah of haft) { | ||
const numv = numverses[aliyah.k]; | ||
t.is(typeof numv, 'object', `${name} => ${aliyah.k}`); | ||
} | ||
} else { | ||
const numv = numverses[haft.k]; | ||
t.is(typeof numv, 'object', `${name} => ${haft.k}`); | ||
} | ||
} | ||
|
||
test('triennial-haft-spelling', (t) => { | ||
for (const [parsha, triHaft] of Object.entries(triennialHaft)) { | ||
if (parsha === '_holidays' || typeof triHaft === 'boolean') { | ||
continue; | ||
} | ||
testAliyah(t, parsha, triHaft['1']); | ||
testAliyah(t, parsha, triHaft['2']); | ||
if (triHaft['3']) { | ||
testAliyah(t, parsha, triHaft['3']); | ||
} | ||
} | ||
for (const [holiday, haft] of Object.entries(triennialHaft._holidays)) { | ||
testAliyah(t, holiday, haft); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters