You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Digital Pet Game lab: PetMood enum and Record tests reject valid TypeScript #71494
frontend libraries v9 certThis is for the issues dealing with the Frontend Libraries V9 Certification.status: waiting triageThis issue needs help from moderators and users to reproduce and confirm its validity and fix.
Build a Digital Pet Game (lab-digital-pet-game, curriculum/challenges/english/blocks/lab-digital-pet-game/68c362b379059c388d3874f2.md)
Describe the issue
The tests that check the PetMood members use regexes like /\s*enum\s+PetMood\s*{[\s*\w+,\s*]*HAPPY[\s*\w+,\s*]*}/. The [...] parts are character classes, so only word characters, whitespace, *, + and , are allowed around each member. Valid enums fail all seven member tests, for example:
enumPetMood{HAPPY="happy",SAD="sad",/* ... */}
or any enum with a comment inside it.
The user stories also list the moods as Happy, Excited, Content, Sad, Tired, Sick, Hungry, but the tests require HAPPY, EXCITED, ... and [PetMood.HAPPY], so a learner following the stories fails every mood test.
The Record<PetMood, string> test (/\s*(?:const|let|var)\s+\w+:\s+Record<PetMood,\s*string>/) requires a space after the colon, so const moods:Record<PetMood, string> fails.
Minor: the hint text reads "Record<PetMood, string" (missing >), and the SAD hint has a stray quote ("SAD'.").
Expected behavior
The tests accept valid enum declarations (initialisers, comments, spacing) and a valid Record annotation, and the user stories use the same member names the tests check.
I'd like to work on this. My plan: fix the PetMood member-test regexes so valid enums pass (initialisers like HAPPY = "happy", comments inside the enum, and varied spacing), fix the Record<PetMood, string> test so it accepts a missing space after the colon, align the user stories with the member names the tests check, and fix the two hint typos (the missing > in the Record hint and the stray quote in the SAD hint). Please assign the issue to me if that works.
@MuhammadAhmad67889 hey — there’s already an open PR that covers the fixes you outlined: #71496 (PetMood enum member regexes, Record spacing, user-story names, and the two hint typos).
Happy to work together on it if you’d like — feel free to review, suggest changes, or take a co-author commit on that PR. No need for a separate one covering the same ground.
frontend libraries v9 certThis is for the issues dealing with the Frontend Libraries V9 Certification.status: waiting triageThis issue needs help from moderators and users to reproduce and confirm its validity and fix.
Activity
MuhammadAhmad67889 commentedon Nov 5, 2026
I'd like to work on this. My plan: fix the PetMood member-test regexes so valid enums pass (initialisers like HAPPY = "happy", comments inside the enum, and varied spacing), fix the Record<PetMood, string> test so it accepts a missing space after the colon, align the user stories with the member names the tests check, and fix the two hint typos (the missing > in the Record hint and the stray quote in the SAD hint). Please assign the issue to me if that works.
jerome-queck commentedon Nov 5, 2026
@MuhammadAhmad67889 hey — there’s already an open PR that covers the fixes you outlined: #71496 (PetMood enum member regexes, Record spacing, user-story names, and the two hint typos).
Happy to work together on it if you’d like — feel free to review, suggest changes, or take a co-author commit on that PR. No need for a separate one covering the same ground.