Skip to content

Commit e908688

Browse files
committed
Update unit tests to work against 4.0 API
1 parent 0c63731 commit e908688

6 files changed

+21
-6
lines changed

src/MishnaYomiEvent.js

+4
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,8 @@ export class MishnaYomiEvent extends Event {
6565
const verse2 = (p1[0] === p2[0]) ? p2[1] : p2.join('.');
6666
return `${prefix}.${verse1}-${verse2}?lang=bi`;
6767
}
68+
/** @return {string[]} */
69+
getCategories() {
70+
return ['mishnayomi'];
71+
}
6872
}

src/NachYomiEvent.js

+4
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,8 @@ export class NachYomiEvent extends Event {
3737
const chapter = this.nachYomi.v;
3838
return `https://www.sefaria.org/${name}.${chapter}?lang=bi`;
3939
}
40+
/** @return {string[]} */
41+
getCategories() {
42+
return ['nachyomi'];
43+
}
4044
}

src/dafyomi.js

+4
Original file line numberDiff line numberDiff line change
@@ -228,4 +228,8 @@ export class DafYomiEvent extends Event {
228228
return `https://www.sefaria.org/${name}.${blatt}a?lang=bi`;
229229
}
230230
}
231+
/** @return {string[]} */
232+
getCategories() {
233+
return ['dafyomi'];
234+
}
231235
}

src/hebcal.spec.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ test('dafyomi-only', (t) => {
1717
isHebrewYear: false,
1818
month: 6,
1919
noHolidays: true,
20-
dafyomi: true,
20+
dailyLearning: {dafYomi: true},
2121
};
2222
const events = HebrewCalendar.calendar(options);
2323
t.is(events.length, 30);
@@ -43,7 +43,7 @@ test('mishnaYomi-only', (t) => {
4343
year: 2022,
4444
isHebrewYear: false,
4545
noHolidays: true,
46-
mishnaYomi: true,
46+
dailyLearning: {mishnaYomi: true},
4747
});
4848
t.is(events.length, 365);
4949
t.is(events[0].getDesc(), 'Berakhot 3:2-3');
@@ -56,7 +56,7 @@ test('yerushalmiYomi-Vilna', (t) => {
5656
start: new Date(1997, 2, 14),
5757
end: new Date(2001, 5, 22),
5858
noHolidays: true,
59-
yerushalmi: true,
59+
dailyLearning: {yerushalmi: true},
6060
});
6161
t.is(events.length, 1554);
6262
const daf1 = events.filter((ev) => ev.daf.blatt === 1);
@@ -110,8 +110,7 @@ test('yerushalmiYomi-Schottenstein', (t) => {
110110
start: new Date(2022, 10, 14),
111111
end: new Date(2028, 7, 7),
112112
noHolidays: true,
113-
yerushalmi: true,
114-
yerushalmiEdition: 2,
113+
dailyLearning: {yerushalmi: 2},
115114
});
116115
t.is(events.length, 2094);
117116
const daf1 = events.filter((ev) => ev.daf.blatt === 1);

src/nachCycle.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ test('nachyomi-2022', (t) => {
1212
start: new Date(2022, 0, 20),
1313
end: new Date(2024, 0, 31),
1414
noHolidays: true,
15-
nachYomi: true,
15+
dailyLearning: {nachYomi: true},
1616
});
1717
const actual = [];
1818
for (const ev of events) {

src/yerushalmi.js

+4
Original file line numberDiff line numberDiff line change
@@ -279,4 +279,8 @@ export class YerushalmiYomiEvent extends Event {
279279
const verses = verses0.replace(/:/g, '.');
280280
return `https://www.sefaria.org/${name}.${verses}?lang=bi`;
281281
}
282+
/** @return {string[]} */
283+
getCategories() {
284+
return ['yerushalmi'];
285+
}
282286
}

0 commit comments

Comments
 (0)