test(compare): run the footguns page's js examples against the pinned libraries
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 66/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, node.js, typescript
- Domain
- devtools, documentation, testing
Research direction
Start with docs/explanation/footguns.md, compare/package.json, and the existing compare job that installs the pinned libraries. Check how doctests parse and format examples, then add a runner for the page’s js fences and execute each in a timed child process. Done means CI reports mismatched or uncounted result comments with the fence identified, while matching pinned-library examples pass.
Written by the indexing model from the issue text.
Description
docs/explanation/footguns.md shows other libraries' wrong results in js fences. Each fence starts with a // library version comment and gives the result as // → value or // throws Class: message. The doctests run only ts blocks, so CI never checks these fences.
Every result was checked by hand against the versions pinned in compare/package.json when #322 merged: 27 fences, 37 results, on Node 24. A pin bump could change a library's behaviour and quietly make a claim on the page false.
Proposal: run the page's js fences in the compare job, which already installs those libraries:
- For each
jsfence, write the code to a module that resolves imports fromcompare/node_modules. Mapdinero.jstodinero-v1when the header says 1.9.1. - Turn each
expr; // → valueline into a check that formats the value the way the doctests do: strings in single quotes, arrays as[a, b], everything else withString(). - Turn each
// throws Class: messageline into a check that the call throws that class with a message starting with the text given. - Run each module in a child process with a timeout. Fail on any mismatch, and when the count of checked comments differs from the count of
// →and// throwscomments, so that a statement the formatter splits over several lines can't be skipped without anyone noticing. - When a pin bump changes a result, the job should fail and name the fence. Then either update the page or move the example to "fixed in X".
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 35m
- Merged PRs (30d)
- 242
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from public/ducat
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
public/ducat#349 · 1 comment ·
Maintainers usually reply within 1 day
-
area: core
Difficulty 4/5 3-5 days Newbie friendliness 43/100
Maintainers usually reply within 1 day
-
area: tests
Difficulty 3/5 1-2 days Newbie friendliness 56/100
Maintainers usually reply within 1 day
-
area: core
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
tintinweb/pi-subagents#459 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
danielmiessler/LifeOS#2830 ·
Maintainers usually reply within 6 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
freshframework/fresh#3920 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
area: client enhancement priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
opensro-dev/opensro#3681 ·
Maintainers usually reply within 1 day