Add Jest tests for musicutils.js to address zero test coverage#6470
Add Jest tests for musicutils.js to address zero test coverage#6470swapnachoudhary43 wants to merge 11 commits intosugarlabs:masterfrom
Conversation
|
✅ All Jest tests passed! This PR is ready to merge. |
|
@swapnachoudhary43 I had pointed out earlier about unrelated files, they're still present here, so please clean those up first. Also, the 0% coverage claim doesn't match what I'm seeing locally for |
|
Please keep this PR focused on |
|
Unrelated changes in the pr |
Remove tempCodeRunnerFile.js from PR
|
✅ All Jest tests passed! This PR is ready to merge. |
|
✅ All Jest tests passed! This PR is ready to merge. |
1 similar comment
|
✅ All Jest tests passed! This PR is ready to merge. |
…apnachoudhary43/musicblocks into test/musicutils-jest-coverage
|
✅ All Jest tests passed! This PR is ready to merge. |
mahesh-09-12
left a comment
There was a problem hiding this comment.
@swapnachoudhary43 this PR includes unrelated files and commits, since the goal is to add tests for musicutils.js, the diff should be scoped only to that, please clean up the history and remove unrelated changes.
and also it looks like some of these tests already exist or overlap with current coverage. Can you clarify what new behavior is actually being tested here?
|
✅ All Jest tests passed! This PR is ready to merge. |
There was a problem hiding this comment.
Hi @swopnachoudhary43! While testing #6471, I found an issue in noteToPitchOctave it doesn’t handle multi-digit octaves (e.g., C10) or double sharps (e.g., Cx4).
To make this PR more robust, it would be great to switch to _parse_pitch_string and export core constants like A0 and SOLFEGECONVERSIONTABLE for better edge-case coverage.
What this PR does
Adds proper Jest test coverage for js/utils/musicutils.js
Background
musicutils.js is one of the largest and most critical files in the
codebase (4427 lines) containing core music utility functions —
MUSICALMODES, PITCHES, key signature logic, and interval calculations.
Without any test coverage, regressions in these functions enter
production silently.
What this adds
Updated file js/utils/tests/musicutils.test.js covering:
Changes made
Tests
All 349 tests pass.
Full suite: 1 suite passing, 0 failures.
Related