Skip to content

Commit

Permalink
Update unit tests to work against 4.0 API
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed Apr 27, 2023
1 parent 0c63731 commit e908688
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/MishnaYomiEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,8 @@ export class MishnaYomiEvent extends Event {
const verse2 = (p1[0] === p2[0]) ? p2[1] : p2.join('.');
return `${prefix}.${verse1}-${verse2}?lang=bi`;
}
/** @return {string[]} */
getCategories() {
return ['mishnayomi'];
}
}
4 changes: 4 additions & 0 deletions src/NachYomiEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,8 @@ export class NachYomiEvent extends Event {
const chapter = this.nachYomi.v;
return `https://www.sefaria.org/${name}.${chapter}?lang=bi`;
}
/** @return {string[]} */
getCategories() {
return ['nachyomi'];
}
}
4 changes: 4 additions & 0 deletions src/dafyomi.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,8 @@ export class DafYomiEvent extends Event {
return `https://www.sefaria.org/${name}.${blatt}a?lang=bi`;
}
}
/** @return {string[]} */
getCategories() {
return ['dafyomi'];
}
}
9 changes: 4 additions & 5 deletions src/hebcal.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test('dafyomi-only', (t) => {
isHebrewYear: false,
month: 6,
noHolidays: true,
dafyomi: true,
dailyLearning: {dafYomi: true},
};
const events = HebrewCalendar.calendar(options);
t.is(events.length, 30);
Expand All @@ -43,7 +43,7 @@ test('mishnaYomi-only', (t) => {
year: 2022,
isHebrewYear: false,
noHolidays: true,
mishnaYomi: true,
dailyLearning: {mishnaYomi: true},
});
t.is(events.length, 365);
t.is(events[0].getDesc(), 'Berakhot 3:2-3');
Expand All @@ -56,7 +56,7 @@ test('yerushalmiYomi-Vilna', (t) => {
start: new Date(1997, 2, 14),
end: new Date(2001, 5, 22),
noHolidays: true,
yerushalmi: true,
dailyLearning: {yerushalmi: true},
});
t.is(events.length, 1554);
const daf1 = events.filter((ev) => ev.daf.blatt === 1);
Expand Down Expand Up @@ -110,8 +110,7 @@ test('yerushalmiYomi-Schottenstein', (t) => {
start: new Date(2022, 10, 14),
end: new Date(2028, 7, 7),
noHolidays: true,
yerushalmi: true,
yerushalmiEdition: 2,
dailyLearning: {yerushalmi: 2},
});
t.is(events.length, 2094);
const daf1 = events.filter((ev) => ev.daf.blatt === 1);
Expand Down
2 changes: 1 addition & 1 deletion src/nachCycle.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test('nachyomi-2022', (t) => {
start: new Date(2022, 0, 20),
end: new Date(2024, 0, 31),
noHolidays: true,
nachYomi: true,
dailyLearning: {nachYomi: true},
});
const actual = [];
for (const ev of events) {
Expand Down
4 changes: 4 additions & 0 deletions src/yerushalmi.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,4 +279,8 @@ export class YerushalmiYomiEvent extends Event {
const verses = verses0.replace(/:/g, '.');
return `https://www.sefaria.org/${name}.${verses}?lang=bi`;
}
/** @return {string[]} */
getCategories() {
return ['yerushalmi'];
}
}

0 comments on commit e908688

Please sign in to comment.