Skip to content

test(ranges): run tests against core's snapshot data at a fixed date - #91

Merged
botandbang merged 3 commits into
bnb/ranges-alphafrom
bnb/ranges-test-fixtures
Oct 20, 2026
Merged

botandbang merged 3 commits into
bnb/ranges-alphafrom
bnb/ranges-test-fixtures

Conversation

@botandbang

Copy link
Copy Markdown
Contributor

Stacked on #90. The ranges tests fetched the live index.json and schedule.json and ran against today's date. On 2026-10-20 v24 moved to maintenance and v26 isn't LTS until 2026-10-28, so lts/latest came back empty, got deleted, and 5 tests threw on undefined.

Added: ranges/test/fixtures.js serves core's checked-in snapshots through the fetch option, keeps only releases out by the given date (default 2025-09-01), and throws on any other URL. On that date v24 is Current, v22 Active LTS, v20 Maintenance and v23 EOL, so every range has versions. A new test in known.test.js pins each range's newest, oldest, security and LTS values; the older tests missed a mutation that routed maintenance releases into lts/latest.

Changed: every ranges call in the tests passes the fixture options, with no assertions changed. alpha.test.js uses the shared helper. The test and coverage scripts run test/*.test.js so the helper isn't counted as a test. The tests-ranges workflow now triggers on ranges/** and core/test/data/static/**; the old ranges/* filter skipped changes under ranges/test/.

the ranges tests fetched the live index.json and schedule.json and used
today's clock, so they broke whenever the real schedule left a range
empty. on 2026-10-20 no line is in Active LTS, which made lts/latest
disappear and failed 5 tests.

add test/fixtures.js, which serves core's checked-in snapshots filtered
to 2025-09-01 and throws on any other URL. pass it to every ranges call,
reuse it in alpha.test.js, add a test that pins each range's
newest/oldest/security/lts values on that date, scope the test scripts
to *.test.js, and widen the tests-ranges workflow path filter to
ranges/** and core's snapshot data.
the ranges tests now run the workspace core and aliases, not just core's
snapshot data, so changes to either should trigger them.
@botandbang
botandbang merged commit 226f025 into bnb/ranges-alpha Oct 20, 2026
13 checks passed
@botandbang
botandbang deleted the bnb/ranges-test-fixtures branch October 20, 2026 22:09
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.

1 participant