Skip to content

Commit

Permalink
test: add test for that stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
zkrising committed Apr 9, 2024
1 parent 2338e7e commit 99d886c
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { ValidateScore } from "./validate-score";
import { ONE_DAY } from "lib/constants/time";
import t from "tap";
import { Testing511SPA, TestingIIDXSPScore } from "test-utils/test-data";

t.test("#ValidateScore", (t) => {
t.test("Should reject scores in the future", (t) => {
t.throws(
() => {
ValidateScore(
{ ...TestingIIDXSPScore, timeAchieved: Date.now() + ONE_DAY * 2 },
Testing511SPA
);
},
{
message: "Invalid timestamp: score happens in the future.",
}
);

t.end();
});

t.end();
});

0 comments on commit 99d886c

Please sign in to comment.