From ee9faafbc8bf9b381e232fc52015ed9dd232779d Mon Sep 17 00:00:00 2001 From: zkldi <20380519+zkldi@users.noreply.github.com> Date: Sun, 17 Jul 2022 23:14:50 +0100 Subject: [PATCH] test: add regression tests for chunithm SSS --- .../lib/score-import/framework/common/score-utils.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/src/lib/score-import/framework/common/score-utils.test.ts b/server/src/lib/score-import/framework/common/score-utils.test.ts index 8d7e1f721..b8ac74349 100644 --- a/server/src/lib/score-import/framework/common/score-utils.test.ts +++ b/server/src/lib/score-import/framework/common/score-utils.test.ts @@ -8,7 +8,7 @@ t.test("#GetGradeForPercent", (t) => { t.equal( GetGradeFromPercent("chunithm", "Single", 101), "SSS", - "Should return SSS for the edge case of chunithms 101% == SS." + "Should return SSS for the edge case of chunithms 101%." ); t.equal( GetGradeFromPercent("iidx", "SP", 100), @@ -47,6 +47,11 @@ t.test("#GetGradeForPercent", (t) => { "Should return SSS for the edge case of 0% == F (iidx DP)." ); + t.throws( + () => GetGradeFromPercent("iidx", "DP", -1), + "Should throw if percent is unresolvable." + ); + t.end(); });