You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wattpad-deno/tests/story.ts

29 lines
875 B

import Wattpad from "../mod.ts";
import type { Story } from "../mod.ts";
import { assert } from "https://deno.land/std@0.167.0/testing/asserts.ts";
export default function test(watt: Wattpad) {
Deno.test("stories", async (test) => {
let work: Story;
await test.step("initialization", async () => {
work = watt.getStory("327425279");
await work.init();
});
await test.step("tags", () => {
assert(work.tags.length > 0, "Failed to parse any tags");
assert(
work.tags.includes("bendyxreader"),
"Failed to get correct tags",
);
});
await test.step("other metadata", () => {
assert(
work.name === "Inky Desires [Bendy X Reader]",
"incorrect work name",
);
});
});
}