mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-12 17:28:31 +03:00
Add some more tests to ensure rejection of nonsense
This commit is contained in:
@@ -46,6 +46,23 @@ t.test("#ParseLR2Hook", (t) => {
|
||||
dm({ scoreData: { unexpectedField: "foo" } }),
|
||||
"Should allow excess keys inside scoreData that we do not recognise."
|
||||
);
|
||||
assertSuccess(
|
||||
dm({ playerData: { unexpectedField: "foo" } }),
|
||||
"Should allow excess keys inside playerData that we do not recognise."
|
||||
);
|
||||
|
||||
assertFail(
|
||||
dm({ playerData: { autoScr: true } }),
|
||||
"Should reject scores where autoScr is set to true."
|
||||
);
|
||||
assertFail(
|
||||
dm({ playerData: { random: "H-RAN" } }),
|
||||
"Should reject scores where random is set to H-RAN."
|
||||
);
|
||||
assertFail(
|
||||
dm({ playerData: { random: "ALLSCR" } }),
|
||||
"Should reject scores where random is set to ALLSCR"
|
||||
);
|
||||
|
||||
assertFail({}, "Should reject an empty object");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user