-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathsearch_test.ts
More file actions
26 lines (24 loc) · 782 Bytes
/
search_test.ts
File metadata and controls
26 lines (24 loc) · 782 Bytes
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
import { assertEquals } from "./test_deps.ts";
import { REGISTRIES } from "./registry.ts";
import { importUrls } from "./search.ts";
Deno.test("denolandImports", () => {
const expected = [
"https://deno.land/std@0.35.0/foo.ts",
"https://deno.land/x/foo@0.35.0/foo.ts",
"npm:preact@10.11.2",
"npm:preact@10.11.2/",
];
// const ts = `
// import { foo } from "${expected[0]}";
// import { bar } from "${expected[1]}";
// `;
const ts = `
import { foo } from "https://deno.land/std@0.35.0/foo.ts";
import { bar } from "https://deno.land/x/foo@0.35.0/foo.ts";
export * as preact from "npm:preact@10.11.2";
export * as hooks from "npm:preact@10.11.2/hooks";
`;
const urls = importUrls(ts, REGISTRIES);
urls.sort();
assertEquals(urls, expected);
});