Scratch repository for testing automations.
Add tests for statistics functions in test.js #18
Resolved by Add tests for statistics functions in test.js #21, merged by syntaqx
Add test cases to test.js for the three new statistics functions: mean, median, and standard_deviation.
For each function:
- Test with a simple array (e.g., [1, 2, 3])
- Test with an even-length array for median (to verify the midpoint average calculation)
- Test that it throws
TypeErrorwhen called with an empty array
Keep the existing tests for add, multiply, and power. The script should still end with "all tests passed".
Definition of done
- Running
node test.jsprints "all tests passed" with all 6 functions tested
Pull requests
1 for this issue