[TST] Improve Jest test assertions to use idiomatic matchers#6998
[TST] Improve Jest test assertions to use idiomatic matchers#6998atharva-deopujari wants to merge 1 commit intochroma-core:mainfrom
Conversation
Reviewer ChecklistPlease leverage this checklist to ensure your code review is thorough before approving Testing, Bugs, Errors, Logs, Documentation
System Compatibility
Quality
|
|
This PR updates the JavaScript test suite to use more idiomatic Jest assertion patterns across 9 test files in The changes are test-only and do not modify production logic. Besides stylistic consistency, the This summary was automatically generated by @propel-code-bot |
Description of changes
Improves the JavaScript client test suite to use idiomatic Jest matchers, as suggested in #2801. Two main patterns addressed:
expect(x.length).toBe(n)→expect(x).toHaveLength(n)(13 instances)try/catchwith manual assertions →rejects.toThrow()(7 instances)try/catchpattern would silently pass if the code didn't throw, since theexpectinsidecatchwould never execute. Therejectspattern correctly fails when the expected error is not thrown.Changes are purely stylistic — no test logic was modified.
Test plan
pytestfor python,yarn testfor js,cargo testfor rustDocumentation Changes
None
Relates to #2801