-
Notifications
You must be signed in to change notification settings - Fork 0
/
mod_test.ts
31 lines (21 loc) · 884 Bytes
/
mod_test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { assertSnapshot } from "@std/testing/snapshot";
import { archive } from "./mod.ts";
import { Effect } from "effect";
Deno.test("should archive a markdown file with all images", async (t) => {
const program = archive(`
# Testing
![Google Logo 1998](https://web.archive.org/web/19990504112211im_/http://www.google.com/google.jpg)
<img src="https://web.archive.org/web/20061116065438im_/http://www.google.com/intl/en_ALL/images/logo.gif" alt="Google Logo 2006" />
`);
const result = await Effect.runPromise(program);
await assertSnapshot(t, result);
});
Deno.test("should use a fallback image if downloading the image failed", async (t) => {
const program = archive(`
# Testing
![](https://example.com/not-found.jpg)
<img src="https://example.com/not-found.jpg" />
`);
const result = await Effect.runPromise(program);
await assertSnapshot(t, result);
});