-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve calculation of yearly average for risk by month
- Add test for risk utils
- Loading branch information
1 parent
abab99e
commit 7f2d573
Showing
2 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { expect, test } from 'vitest'; | ||
|
||
import { CATEGORY_RISK_LOW, CATEGORY_RISK_VERY_LOW } from '#utils/constants'; | ||
|
||
import { riskScoreToCategory } from './risk.ts'; | ||
|
||
test('Risk score to category', () => { | ||
expect( | ||
riskScoreToCategory( | ||
0, | ||
'FL', | ||
), | ||
).toEqual(CATEGORY_RISK_VERY_LOW); | ||
expect( | ||
riskScoreToCategory( | ||
3, | ||
'FL', | ||
), | ||
).toEqual(CATEGORY_RISK_LOW); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters