Skip to content

Commit

Permalink
somehow I'm confused assertIsError is different from assertThrows wtf
Browse files Browse the repository at this point in the history
Signed-off-by: chinodesuuu <chinodesuuu@gmail.com>
  • Loading branch information
sr229 committed Aug 27, 2024
1 parent 502d18e commit d16044e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/deno/sagiri.test.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { assertIsError, assertExists } from "@std/assert";
import { assertThrows, assertExists } from "@std/assert";
import sagiri from "../../lib/sagiri.ts";

Deno.test("should fail on invalid characters", () => {
assertIsError(sagiri("!!!!!*&#@(!)"));
assertThrows(() => { sagiri("!!!!!*&#@(!)") });
});

Deno.test("should fail on invalid length", () => {
assertIsError(sagiri("7".repeat(27)));
assertThrows(() => { sagiri("7".repeat(27)) });
});

Deno.test("Resolve with results", () => {
assertExists(()=> {sagiri(Deno.env.get("SAUCENAO_TOKEN")!)("https://i.imgur.com/F9QSgPx.jpeg")}, "pixiv");
assertExists(() => { sagiri(Deno.env.get("SAUCENAO_TOKEN")!)("https://i.imgur.com/F9QSgPx.jpeg") }, "pixiv");
})

0 comments on commit d16044e

Please sign in to comment.