14 lines
552 B
JavaScript
14 lines
552 B
JavaScript
const assert = require("node:assert/strict");
|
|
const calendar = require("../static/calendar.js");
|
|
|
|
const birthdays = {
|
|
spring: { 4: ["Kent", 2], 7: ["Lewis"] }
|
|
};
|
|
|
|
assert.equal(calendar.birthdayOn(birthdays, "spring", 4, 1), null);
|
|
assert.equal(calendar.birthdayOn(birthdays, "spring", 4, 2), "Kent");
|
|
assert.equal(calendar.birthdayOn(birthdays, "spring", 7, 1), "Lewis");
|
|
assert.equal(calendar.birthdayOn(birthdays, "spring", 7, 2), "Lewis");
|
|
assert.equal(calendar.birthdayOn(birthdays, "spring", 8, 1), null);
|
|
|
|
console.log("calendar tests passed");
|