slige/surveys/code_coverage/program_1_test.ts

14 lines
408 B
TypeScript
Raw Normal View History

2024-11-21 16:16:30 +01:00
import { assertEquals } from "jsr:@std/assert";
import { playerFromUnknown } from "./program_1.ts";
Deno.test("must work", () => {
assertEquals(
playerFromUnknown("miklz-33"),
{ ok: true, value: { username: "miklz", level: 33 } },
);
assertEquals(
playerFromUnknown({ username: "piet", level: 2 }),
{ ok: true, value: { username: "piet", level: 2 } },
);
});