sandbag icon indicating copy to clipboard operation
sandbag copied to clipboard

test: Improve coverage for Saxon Scales.

Open marinojoey opened this issue 2 years ago β€’ 2 comments

I was trying to make a test for '7a/7b' but it was erroring that it was not an expected Saxon Grade. I believe this is a problem with the regex in src/scales/saxon.ts. From some simple testing, this regex matches '7a/7b': 1/^((([7-9]|1[0-3])([a-c]))|([1-6])|([7-9]|1[0-3])(([a-c])\/([7-9]|1[0-3])([a-c])))$/i.

For now I pushed up tests that pass inside one commit. For the sake of performance, they were specifically written to improve coverage and nothing else (i.e. __tests__/saxon.ts is not a comprehensive test suite for the Saxon system).

The other commit includes a potential solution to the grade regex.

marinojoey avatar Sep 01 '23 20:09 marinojoey

Coverage report

Statements coverage not met for global: expected <=999999 not covered statements, but got 549

St.:grey_question:
Category Percentage Covered / Total
🟒 Statements
86.87% (+0.47% πŸ”Ό)
549/632
🟑 Branches
65.9% (+0.58% πŸ”Ό)
114/173
🟒 Functions
80.15% (+0.74% πŸ”Ό)
109/136
🟒 Lines
86.08% (+0.51% πŸ”Ό)
507/589

Test suite run success

258 tests passing in 17 suites.

Report generated by πŸ§ͺjest coverage report action from 1b8f6f3ab8024bbd61552c90bf10046f96db590e

github-actions[bot] avatar Sep 01 '23 20:09 github-actions[bot]

Could you move the existing tests to the location of your current tests and add any new cases to that?

@marinojoey can you finish this PR?

vnugent avatar Oct 18 '23 15:10 vnugent