microsoft/typespec
Publicmirrored from https://github.com/microsoft/typespecAvailable
packages/html-program-viewer/test/test-host.ts
17lines · modecode
| 1 | import { createTestHost, createTestWrapper } from "@typespec/compiler/testing"; |
| 2 | import { ProgramViewerTestLibrary } from "../src/testing/index.js"; |
| 3 | |
| 4 | export async function createOpenAPITestHost() { |
| 5 | return createTestHost({ |
| 6 | libraries: [ProgramViewerTestLibrary], |
| 7 | }); |
| 8 | } |
| 9 | |
| 10 | export async function createViewerTestRunner() { |
| 11 | const host = await createOpenAPITestHost(); |
| 12 | return createTestWrapper(host, { |
| 13 | compilerOptions: { |
| 14 | emitters: { "@typespec/html-program-viewer": {} }, |
| 15 | }, |
| 16 | }); |
| 17 | } |
| 18 | |