We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 78c41fc commit 761c6c1Copy full SHA for 761c6c1
lib/unpkg-url.test.ts
@@ -0,0 +1,28 @@
1
+import { expect, test } from "vitest";
2
+import { makeUnpkgUrl } from "./unpkg-url";
3
+
4
+test("unpkgUrl", () => {
5
+ const unpkgUrl = makeUnpkgUrl(["foo@1.0.0"]);
6
+ expect(
7
+ unpkgUrl({
8
+ kind: "variable",
9
+ id: "foo",
10
+ name: "foo",
11
+ docs: [],
12
+ file: "/foo/foo.ts",
13
+ line: 123,
14
+ signature: "const foo: Foo;",
15
+ }),
16
+ ).toMatchInlineSnapshot(`"https://unpkg.com/browse/foo@1.0.0/foo.ts#L123"`);
17
18
19
20
+ id: "bar",
21
+ name: "bar",
22
23
+ file: "/bar/bar.ts",
24
25
+ signature: "const bar: Bar;",
26
27
+ ).toMatchInlineSnapshot(`"https://unpkg.com/browse/bar/bar.ts#L123"`);
28
+});
0 commit comments