|
1 | 1 | import dedent from "ts-dedent"; |
2 | | -import { |
3 | | - ModuleKind, |
4 | | - ModuleResolutionKind, |
5 | | - Project, |
6 | | - ScriptTarget, |
7 | | -} from "ts-morph"; |
| 2 | +import { ModuleKind, ModuleResolutionKind, Project, ScriptTarget } from "ts-morph"; |
8 | 3 | import { expect, test } from "vitest"; |
9 | 4 | import { docs } from "./docs"; |
10 | 5 |
|
@@ -56,36 +51,26 @@ test("docs", () => { |
56 | 51 | export type Qux = {}; |
57 | 52 | `, |
58 | 53 | ); |
59 | | - expect(docs(indexFile.getVariableDeclarationOrThrow("foo"))).toStrictEqual( |
60 | | - [], |
61 | | - ); |
| 54 | + expect(docs(indexFile.getVariableDeclarationOrThrow("foo"))).toStrictEqual([]); |
62 | 55 | expect(docs(indexFile.getVariableDeclarationOrThrow("bar"))).toStrictEqual([ |
63 | 56 | "/** Docs for bar */", |
64 | 57 | ]); |
65 | | - expect( |
66 | | - docs(indexFile.getExportedDeclarations().get("default")?.at(0)!), |
67 | | - ).toStrictEqual(["/** Docs for expression */"]); |
| 58 | + expect(docs(indexFile.getExportedDeclarations().get("default")?.at(0)!)).toStrictEqual([ |
| 59 | + "/** Docs for expression */", |
| 60 | + ]); |
68 | 61 | expect(docs(indexFile.getFunctionOrThrow("fooFunc"))).toStrictEqual([ |
69 | 62 | "/** Docs for function overloads 1 */", |
70 | 63 | "/** Docs for function overloads 2 */", |
71 | 64 | ]); |
72 | | - expect( |
73 | | - docs(indexFile.getClassOrThrow("FooClass").getMethodOrThrow("fooMethod")), |
74 | | - ).toStrictEqual([ |
| 65 | + expect(docs(indexFile.getClassOrThrow("FooClass").getMethodOrThrow("fooMethod"))).toStrictEqual([ |
75 | 66 | "/** Docs for class method overloads 1 */", |
76 | 67 | "/** Docs for class method overloads 2 */", |
77 | 68 | ]); |
78 | 69 | expect( |
79 | | - docs( |
80 | | - indexFile |
81 | | - .getInterfaceOrThrow("FooInterface") |
82 | | - .getMethodOrThrow("fooMethod"), |
83 | | - ), |
| 70 | + docs(indexFile.getInterfaceOrThrow("FooInterface").getMethodOrThrow("fooMethod")), |
84 | 71 | ).toStrictEqual([ |
85 | 72 | "/** Docs for interface method overloads 1 */", |
86 | 73 | "/** Docs for interface method overloads 2 */", |
87 | 74 | ]); |
88 | | - expect(docs(indexFile.getTypeAliasOrThrow("Qux"))).toStrictEqual([ |
89 | | - "/** Docs for Qux */", |
90 | | - ]); |
| 75 | + expect(docs(indexFile.getTypeAliasOrThrow("Qux"))).toStrictEqual(["/** Docs for Qux */"]); |
91 | 76 | }); |
0 commit comments