1
0
Fork 0
mirror of https://github.com/classchartsapi/classcharts-api-js.git synced 2026-05-14 19:59:37 +00:00
classcharts-api-js/src/core/studentClient_test.ts
James Cook b2af13c315 fix: remove import map
Doesn't work with importing in deno
2023-09-24 13:36:35 +01:00

24 lines
623 B
TypeScript

import { assertRejects } from "../../deps_dev.ts";
import { StudentClient } from "../core/studentClient.ts";
Deno.test("Throws when no student code is provided", async () => {
const client = new StudentClient("");
await assertRejects(
async () => {
await client.login();
},
Error,
"Student Code not provided",
);
});
Deno.test("Throws with invalid student code", async () => {
const client = new StudentClient("invalid");
await assertRejects(
async () => {
await client.login();
},
Error,
"Unauthenticated: ClassCharts didn't return authentication cookies",
);
});