deno.land / x / esm@v135_2 / test / types-only / types-only.test.ts

types-only.test.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { assertEquals,assertStringIncludes } from "https://deno.land/std@0.180.0/testing/asserts.ts";
Deno.test("types only", async () => { const { version } = await fetch("http://localhost:8080/status.json").then( (r) => r.json(), ); const res = await fetch( "http://localhost:8080/@octokit-next/types-rest-api@2.5.0", ); res.body?.cancel(); assertEquals(res.status, 200); assertEquals( res.headers.get("content-type"), "application/javascript; charset=utf-8", ); const dtsUrl = `http://localhost:8080/v${version}/@octokit-next/types-rest-api@2.5.0/index.d.ts`; assertEquals(res.headers.get("x-typescript-types"), dtsUrl); const dts = await fetch(dtsUrl).then((r) => r.text()); assertStringIncludes(dts, `declare module "http://localhost:8080/v${version}/@octokit-next/types@2.5.0/index.d.ts"`)});
esm

Version Info

Tagged at
a year ago