Skip to content

Add Kiddush Levana tests#34

Open
mjradwin wants to merge 11 commits into
BehindTheMath:masterfrom
mjradwin:claude/add-kiddush-levana-tests-3fafl
Open

Add Kiddush Levana tests#34
mjradwin wants to merge 11 commits into
BehindTheMath:masterfrom
mjradwin:claude/add-kiddush-levana-tests-3fafl

Conversation

@mjradwin

@mjradwin mjradwin commented Apr 5, 2026

Copy link
Copy Markdown

Added 29 new Kiddush Levana tests to tests/complex.test.ts covering all five ComplexZmanimCalendar methods:

Methods tested:

  • getZmanMolad()
  • getTchilasZmanKidushLevana3Days()
  • getTchilasZmanKidushLevana7Days()
  • getSofZmanKidushLevanaBetweenMoldos()
  • getSofZmanKidushLevana15Days()

Coverage achieved:

  • Day 10 (null): All 5 methods confirmed to return null
  • Days 28, 29, 30, 1: Each tested individually with all methods
  • Day-of-month filters: Tested both below-range and above-range boundaries for each method
  • Non-null returns: Verified exact return values on days when the zman actually occurs
  • Forward-to-next-month logic: Exercised getZmanMolad day > 26 forward path (days 28 and 30) and getTchilasZmanKidushLevana3Days day == 30 forward path
  • getMoladBasedTime paths: Covered the null path (zman outside midnight-midnight), the no-alos/tzais path (returns raw time), and the alos/tzais path (returns alos for daytime zman)

All 255 tests pass (was 226, added 29 new).

mjradwin and others added 11 commits March 30, 2025 12:16
This commit adds a new test file `tests/ComplexZmanimCalendar.test.ts` with comprehensive unit tests for the `ComplexZmanimCalendar` class.

The tests cover all public methods, ensuring their current behavior is captured and protected against future regressions. The test setup uses a fixed location and date for consistency and comparability with other tests in the suite.
…dar.ts`.

While working on this, I also found and fixed a bug in the `isAssurBemlacha` method. The issue was that `Temporal.ZonedDateTime` objects were being compared incorrectly.

The new tests are located in `tests/ZmanimCalendar.test.ts`. To ensure their accuracy, I generated the expected values from the current version of your library.
Test all five Kiddush Levana methods (getZmanMolad, getTchilasZmanKidushLevana3Days,
getTchilasZmanKidushLevana7Days, getSofZmanKidushLevanaBetweenMoldos,
getSofZmanKidushLevana15Days) with edge cases for Hebrew month days 28, 29, 30, and 1.
Verifies null return for day 10 and other out-of-range days, tests forward-to-next-month
logic for getZmanMolad and 3days on day 30, and covers alos/tzais daytime adjustment path
through getMoladBasedTime.

https://claude.ai/code/session_01TFJ6vGqedtk2GC9kvRkAUp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants