mirror of
https://github.com/classchartsapi/classcharts-api-js.git
synced 2026-05-14 19:59:37 +00:00
feat: denoify (#33)
This commit is contained in:
parent
f2981dd167
commit
f86ded2ae3
31 changed files with 331 additions and 4940 deletions
25
src/core/studentClient_test.ts
Normal file
25
src/core/studentClient_test.ts
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import { assertRejects } from "https://deno.land/std@0.200.0/assert/mod.ts";
|
||||
|
||||
import { StudentClient } from "./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"
|
||||
);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue