bring server files into project.

This commit is contained in:
2025-01-21 11:50:01 -08:00
parent 58d100b5d3
commit 8700c431cf
32 changed files with 2200 additions and 9 deletions

View File

@ -0,0 +1,15 @@
import { describe, it } from "node:test";
import { getDiceRoll } from "../../getDiceRoll";
import { deepEqual } from "node:assert/strict";
function testRandom() {
const val = [0, 0.2, 0.5, 0.5, 0.7, 0.9];
return () => val.shift()!;
}
describe("getDiceRoll", () => {
it("should return an array of numbers from 1 to 6 with a given length", () => {
let rand = getDiceRoll(6, testRandom());
deepEqual(rand, [0, 1, 3, 3, 4, 6]);
});
});