🧪 testing: add tests for validateMetadataFile - #7
Conversation
- Refactor `scripts/validate-metadata.js` to only run `main()` if executed directly. - Export `validateMetadataFile` to allow testing it in isolation. - Add comprehensive test suite in `tests/validate-metadata.test.js` covering valid files, missing files, and invalid configuration scenarios using temporary directory fixtures. Co-authored-by: akutuva21 <44119804+akutuva21@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
akutuva21
left a comment
There was a problem hiding this comment.
Reviewed in sequence. validateMetadataFile tests are meaningful, and branch now preserves parseScalar export compatibility with adjacent test PRs.
🎯 What: This PR adds a comprehensive unit test suite for the
validateMetadataFilefunction inscripts/validate-metadata.js, addressing a key testing gap in metadata validation.📊 Coverage: The new tests cover the happy path (valid metadata structure alongside a
README.mdand.bnglmodels), as well as missing file errors (README.mdor.bngl), malformed/missing fields within themetadata.yaml, and edge cases surrounding collections and multiple model combinations.✨ Result: The
validate-metadata.jsscript is now fully testable via Node's native test runner without executing side effects globally, ensuring confident iteration on the metadata validation script without risking regressions.PR created automatically by Jules for task 11326954674524457256 started by @akutuva21