feat(nikki): track Infinity Nikki
Adds the game and its Game8 events page. One `SOURCES` entry against the existing game8 parser, plus one date shape that page needs: `parseLabelledStartEnd` reads a duration cell holding `Start: <date>` and `End: <date>` split by a `<br>`, which a tag-stripping reader flattens into one run of text. Four of the seven events say `End: Permanent`. That is the source telling us there is no deadline, so they publish with `endsAt: null` and `endPrecision: "unknown"` rather than a plausible date. The labelled cell is also structure end to end, so it never becomes a summary — stripping the leading half would leave "End: Permanent" standing where a description belongs. Verified by re-extracting the page with a throwaway script independent of the parser: 7 rows in, 7 events out, every date matching. Note the source itself is stale — its "Current Events" table still lists January-May 2025 and "Upcoming Events" says there are none. The adapter is right; the page looks abandoned, and Nikki coverage worth relying on needs a second source at a higher priority. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5
parent
243c7d70dd
commit
67951e81b4
@@ -1,6 +1,7 @@
|
||||
import { describe, expect, test } from "bun:test";
|
||||
import {
|
||||
parseFullRange,
|
||||
parseLabelledStartEnd,
|
||||
parseMonthDayRange,
|
||||
parseMonthDayYear,
|
||||
parseOpenRange,
|
||||
@@ -127,3 +128,39 @@ describe("parseOpenRange", () => {
|
||||
expect(parseOpenRange("Releases in Version 3.6")).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
describe("parseLabelledStartEnd", () => {
|
||||
test("reads a labelled cell", () => {
|
||||
expect(
|
||||
parseLabelledStartEnd("Start: April 28, 2025 End: June 12, 2025"),
|
||||
).toEqual({
|
||||
start: { iso: "2025-04-28T00:00:00.000Z", precision: "day" },
|
||||
end: { iso: "2025-06-12T00:00:00.000Z", precision: "day" },
|
||||
});
|
||||
});
|
||||
|
||||
test("reports no end when the end half is not a date", () => {
|
||||
// "Permanent" is the source telling us there is no deadline. Inventing one
|
||||
// is the failure this codebase exists to prevent.
|
||||
const permanent = parseLabelledStartEnd(
|
||||
"Start: January 24, 2025 End: Permanent",
|
||||
);
|
||||
expect(permanent?.start.iso).toBe("2025-01-24T00:00:00.000Z");
|
||||
expect(permanent?.end).toBeNull();
|
||||
|
||||
expect(parseLabelledStartEnd("Start: January 24, 2025 End: TBD")?.end).toBeNull();
|
||||
expect(parseLabelledStartEnd("Start: January 24, 2025")?.end).toBeNull();
|
||||
});
|
||||
|
||||
test("returns null when the start half is not a date", () => {
|
||||
expect(parseLabelledStartEnd("Start: After maintenance End: TBD")).toBeNull();
|
||||
expect(parseLabelledStartEnd("Ends after 30 days of making your account.")).toBeNull();
|
||||
});
|
||||
|
||||
test("requires the colons, so prose containing 'end' does not split", () => {
|
||||
// Without them, any sentence mentioning an end would look like a boundary.
|
||||
expect(
|
||||
parseLabelledStartEnd("Start the quest before August 12, 2026 to end the arc"),
|
||||
).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user