-
-
Notifications
You must be signed in to change notification settings - Fork 34.4k
test: add some validation for JSON doc output #61413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #61413 +/- ##
==========================================
- Coverage 88.53% 88.52% -0.02%
==========================================
Files 704 704
Lines 208876 208883 +7
Branches 40330 40338 +8
==========================================
- Hits 184937 184904 -33
- Misses 15922 15969 +47
+ Partials 8017 8010 -7 🚀 New features to boost your workflow:
|
ovflowd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM!
| if (dirent.name !== 'index.md') { | ||
| assert.ok(json.introduced_in || Object.values(json).at(-1)?.[0].introduced_in); | ||
| } | ||
| assert.deepStrictEqual(Object.keys(json), ['type', 'source', ...({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this change over time as more api files are added? Should we document that somewhere?
We don't have any validation for the JSON output of the docs, errors can easily slip up there. Those tests become more important to gain confidence to switch a different system to generate those.
It's also a way to enforce consistency as demonstrated by the Markdown change in this PR.