@alloy-js/csharp 0.18.0-dev.24 → 0.18.0-dev.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/dist/src/components/Class.d.ts +26 -0
  2. package/dist/src/components/Class.d.ts.map +1 -0
  3. package/dist/src/components/{ClassDeclaration.js → Class.js} +38 -70
  4. package/dist/src/components/ClassMethod.d.ts +5 -44
  5. package/dist/src/components/ClassMethod.d.ts.map +1 -1
  6. package/dist/src/components/ClassMethod.js +9 -33
  7. package/dist/src/components/Enum.d.ts +15 -0
  8. package/dist/src/components/Enum.d.ts.map +1 -0
  9. package/dist/src/components/{EnumDeclaration.js → Enum.js} +5 -25
  10. package/dist/src/components/Parameters.d.ts +13 -0
  11. package/dist/src/components/Parameters.d.ts.map +1 -0
  12. package/dist/src/components/Parameters.js +34 -0
  13. package/dist/src/components/SourceFile.d.ts.map +1 -1
  14. package/dist/src/components/SourceFile.js +0 -1
  15. package/dist/src/components/index.d.ts +4 -14
  16. package/dist/src/components/index.d.ts.map +1 -1
  17. package/dist/src/components/index.js +5 -15
  18. package/dist/src/components/stc/index.d.ts +2 -2
  19. package/dist/src/components/stc/index.d.ts.map +1 -1
  20. package/dist/src/components/stc/index.js +2 -2
  21. package/dist/src/modifiers.d.ts +4 -10
  22. package/dist/src/modifiers.d.ts.map +1 -1
  23. package/dist/src/modifiers.js +32 -9
  24. package/dist/src/name-policy.d.ts +1 -1
  25. package/dist/src/name-policy.d.ts.map +1 -1
  26. package/dist/src/name-policy.js +0 -2
  27. package/dist/test/class-method.test.js +14 -37
  28. package/dist/test/class.test.d.ts +2 -0
  29. package/dist/test/class.test.d.ts.map +1 -0
  30. package/dist/test/class.test.js +298 -0
  31. package/dist/test/enum.test.js +12 -12
  32. package/dist/test/namespace.test.js +8 -8
  33. package/dist/test/projectdirectory.test.d.ts +2 -0
  34. package/dist/test/projectdirectory.test.d.ts.map +1 -0
  35. package/dist/test/{project-directory.test.js → projectdirectory.test.js} +8 -8
  36. package/dist/test/sourcefile.test.js +4 -4
  37. package/dist/test/using.test.js +9 -9
  38. package/dist/tsconfig.tsbuildinfo +1 -1
  39. package/package.json +3 -4
  40. package/src/components/Class.tsx +149 -0
  41. package/src/components/ClassMethod.tsx +15 -74
  42. package/src/components/{EnumDeclaration.tsx → Enum.tsx} +6 -30
  43. package/src/components/Parameters.tsx +51 -0
  44. package/src/components/SourceFile.tsx +0 -1
  45. package/src/components/index.ts +4 -14
  46. package/src/components/stc/index.ts +2 -2
  47. package/src/modifiers.ts +42 -25
  48. package/src/name-policy.ts +0 -5
  49. package/temp/api.json +1298 -6463
  50. package/test/class-method.test.tsx +14 -24
  51. package/test/class.test.tsx +292 -0
  52. package/test/enum.test.tsx +11 -11
  53. package/test/namespace.test.tsx +4 -4
  54. package/test/{project-directory.test.tsx → projectdirectory.test.tsx} +4 -4
  55. package/test/sourcefile.test.tsx +2 -2
  56. package/test/using.test.tsx +9 -9
  57. package/vitest.config.ts +0 -3
  58. package/dist/src/components/ClassDeclaration.d.ts +0 -92
  59. package/dist/src/components/ClassDeclaration.d.ts.map +0 -1
  60. package/dist/src/components/EnumDeclaration.d.ts +0 -34
  61. package/dist/src/components/EnumDeclaration.d.ts.map +0 -1
  62. package/dist/src/components/attributes/attributes.d.ts +0 -39
  63. package/dist/src/components/attributes/attributes.d.ts.map +0 -1
  64. package/dist/src/components/attributes/attributes.js +0 -62
  65. package/dist/src/components/attributes/attributes.test.d.ts +0 -2
  66. package/dist/src/components/attributes/attributes.test.d.ts.map +0 -1
  67. package/dist/src/components/attributes/attributes.test.js +0 -75
  68. package/dist/src/components/doc/comment.d.ts +0 -70
  69. package/dist/src/components/doc/comment.d.ts.map +0 -1
  70. package/dist/src/components/doc/comment.js +0 -88
  71. package/dist/src/components/doc/comment.test.d.ts +0 -2
  72. package/dist/src/components/doc/comment.test.d.ts.map +0 -1
  73. package/dist/src/components/doc/comment.test.js +0 -348
  74. package/dist/src/components/doc/from-markdown.d.ts +0 -6
  75. package/dist/src/components/doc/from-markdown.d.ts.map +0 -1
  76. package/dist/src/components/doc/from-markdown.js +0 -58
  77. package/dist/src/components/doc/from-markdown.test.d.ts +0 -2
  78. package/dist/src/components/doc/from-markdown.test.d.ts.map +0 -1
  79. package/dist/src/components/doc/from-markdown.test.js +0 -83
  80. package/dist/src/components/interface/declaration.d.ts +0 -65
  81. package/dist/src/components/interface/declaration.d.ts.map +0 -1
  82. package/dist/src/components/interface/declaration.js +0 -83
  83. package/dist/src/components/interface/declaration.test.d.ts +0 -2
  84. package/dist/src/components/interface/declaration.test.d.ts.map +0 -1
  85. package/dist/src/components/interface/declaration.test.js +0 -171
  86. package/dist/src/components/interface/method.d.ts +0 -50
  87. package/dist/src/components/interface/method.d.ts.map +0 -1
  88. package/dist/src/components/interface/method.js +0 -74
  89. package/dist/src/components/interface/method.test.d.ts +0 -2
  90. package/dist/src/components/interface/method.test.d.ts.map +0 -1
  91. package/dist/src/components/interface/method.test.js +0 -300
  92. package/dist/src/components/interface/property.d.ts +0 -56
  93. package/dist/src/components/interface/property.d.ts.map +0 -1
  94. package/dist/src/components/interface/property.js +0 -73
  95. package/dist/src/components/interface/property.test.d.ts +0 -2
  96. package/dist/src/components/interface/property.test.d.ts.map +0 -1
  97. package/dist/src/components/interface/property.test.js +0 -189
  98. package/dist/src/components/parameters/parameters.d.ts +0 -19
  99. package/dist/src/components/parameters/parameters.d.ts.map +0 -1
  100. package/dist/src/components/parameters/parameters.js +0 -43
  101. package/dist/src/components/property/property.d.ts +0 -80
  102. package/dist/src/components/property/property.d.ts.map +0 -1
  103. package/dist/src/components/property/property.js +0 -76
  104. package/dist/src/components/property/property.test.d.ts +0 -2
  105. package/dist/src/components/property/property.test.d.ts.map +0 -1
  106. package/dist/src/components/property/property.test.js +0 -242
  107. package/dist/src/components/record/declaration.d.ts +0 -35
  108. package/dist/src/components/record/declaration.d.ts.map +0 -1
  109. package/dist/src/components/record/declaration.js +0 -90
  110. package/dist/src/components/record/declaration.test.d.ts +0 -2
  111. package/dist/src/components/record/declaration.test.d.ts.map +0 -1
  112. package/dist/src/components/record/declaration.test.js +0 -94
  113. package/dist/src/components/type-parameters/type-parameter-constraints.d.ts +0 -8
  114. package/dist/src/components/type-parameters/type-parameter-constraints.d.ts.map +0 -1
  115. package/dist/src/components/type-parameters/type-parameter-constraints.js +0 -44
  116. package/dist/src/components/type-parameters/type-parameter-constraints.test.d.ts +0 -2
  117. package/dist/src/components/type-parameters/type-parameter-constraints.test.d.ts.map +0 -1
  118. package/dist/src/components/type-parameters/type-parameter-constraints.test.js +0 -67
  119. package/dist/src/components/type-parameters/type-parameter.d.ts +0 -20
  120. package/dist/src/components/type-parameters/type-parameter.d.ts.map +0 -1
  121. package/dist/src/components/type-parameters/type-parameter.js +0 -22
  122. package/dist/src/components/type-parameters/type-parameters.d.ts +0 -17
  123. package/dist/src/components/type-parameters/type-parameters.d.ts.map +0 -1
  124. package/dist/src/components/type-parameters/type-parameters.js +0 -54
  125. package/dist/src/components/type-parameters/type-parameters.test.d.ts +0 -2
  126. package/dist/src/components/type-parameters/type-parameters.test.d.ts.map +0 -1
  127. package/dist/src/components/type-parameters/type-parameters.test.js +0 -48
  128. package/dist/src/components/var/declaration.d.ts +0 -35
  129. package/dist/src/components/var/declaration.d.ts.map +0 -1
  130. package/dist/src/components/var/declaration.js +0 -40
  131. package/dist/src/components/var/declaration.test.d.ts +0 -2
  132. package/dist/src/components/var/declaration.test.d.ts.map +0 -1
  133. package/dist/src/components/var/declaration.test.js +0 -73
  134. package/dist/test/class-declaration.test.d.ts +0 -2
  135. package/dist/test/class-declaration.test.d.ts.map +0 -1
  136. package/dist/test/class-declaration.test.js +0 -481
  137. package/dist/test/project-directory.test.d.ts +0 -2
  138. package/dist/test/project-directory.test.d.ts.map +0 -1
  139. package/dist/test/vitest.setup.d.ts +0 -2
  140. package/dist/test/vitest.setup.d.ts.map +0 -1
  141. package/dist/test/vitest.setup.js +0 -1
  142. package/src/components/ClassDeclaration.tsx +0 -233
  143. package/src/components/attributes/attributes.test.tsx +0 -61
  144. package/src/components/attributes/attributes.tsx +0 -100
  145. package/src/components/doc/comment.test.tsx +0 -337
  146. package/src/components/doc/comment.tsx +0 -152
  147. package/src/components/doc/from-markdown.test.tsx +0 -103
  148. package/src/components/doc/from-markdown.tsx +0 -58
  149. package/src/components/interface/declaration.test.tsx +0 -158
  150. package/src/components/interface/declaration.tsx +0 -125
  151. package/src/components/interface/method.test.tsx +0 -293
  152. package/src/components/interface/method.tsx +0 -122
  153. package/src/components/interface/property.test.tsx +0 -165
  154. package/src/components/interface/property.tsx +0 -127
  155. package/src/components/parameters/parameters.tsx +0 -74
  156. package/src/components/property/property.test.tsx +0 -209
  157. package/src/components/property/property.tsx +0 -172
  158. package/src/components/record/declaration.test.tsx +0 -73
  159. package/src/components/record/declaration.tsx +0 -109
  160. package/src/components/type-parameters/type-parameter-constraints.test.tsx +0 -93
  161. package/src/components/type-parameters/type-parameter-constraints.tsx +0 -46
  162. package/src/components/type-parameters/type-parameter.tsx +0 -35
  163. package/src/components/type-parameters/type-parameters.test.tsx +0 -46
  164. package/src/components/type-parameters/type-parameters.tsx +0 -63
  165. package/src/components/var/declaration.test.tsx +0 -59
  166. package/src/components/var/declaration.tsx +0 -47
  167. package/test/class-declaration.test.tsx +0 -430
  168. package/test/vitest.setup.ts +0 -1
@@ -1,481 +0,0 @@
1
- import { createComponent as _$createComponent, mergeProps as _$mergeProps, createIntrinsic as _$createIntrinsic } from "@alloy-js/core/jsx-runtime";
2
- import * as core from "@alloy-js/core";
3
- import { List, refkey } from "@alloy-js/core";
4
- import * as coretest from "@alloy-js/core/testing";
5
- import { describe, expect, it } from "vitest";
6
- import { Attribute } from "../src/components/attributes/attributes.js";
7
- import * as csharp from "../src/index.js";
8
- import { ClassDeclaration, ClassMember, Property, SourceFile } from "../src/index.js";
9
- import * as utils from "./utils.js";
10
- it("declares class with no members", () => {
11
- expect(_$createComponent(utils.TestNamespace, {
12
- get children() {
13
- return _$createComponent(ClassDeclaration, {
14
- name: "TestClass"
15
- });
16
- }
17
- })).toRenderTo(`
18
- class TestClass;
19
- `);
20
- });
21
- describe("modifiers", () => {
22
- it.each(["public", "private"])("%s", mod => {
23
- expect(_$createComponent(utils.TestNamespace, {
24
- get children() {
25
- return _$createComponent(ClassDeclaration, _$mergeProps({
26
- [mod]: true
27
- }, {
28
- name: "TestClass"
29
- }));
30
- }
31
- })).toRenderTo(`
32
- ${mod} class TestClass;
33
- `);
34
- });
35
- it.each(["partial", "abstract", "static", "sealed"])("%s", mod => {
36
- expect(_$createComponent(utils.TestNamespace, {
37
- get children() {
38
- return _$createComponent(ClassDeclaration, _$mergeProps({
39
- [mod]: true
40
- }, {
41
- name: "TestClass"
42
- }));
43
- }
44
- })).toRenderTo(`
45
- ${mod} class TestClass;
46
- `);
47
- });
48
- it("combines modifiers", () => {
49
- expect(_$createComponent(utils.TestNamespace, {
50
- get children() {
51
- return _$createComponent(ClassDeclaration, {
52
- "public": true,
53
- abstract: true,
54
- partial: true,
55
- name: "TestClass"
56
- });
57
- }
58
- })).toRenderTo(`
59
- public abstract partial class TestClass;
60
- `);
61
- });
62
- });
63
- describe("base", () => {
64
- it("define base class", () => {
65
- expect(_$createComponent(utils.TestNamespace, {
66
- get children() {
67
- return _$createComponent(csharp.ClassDeclaration, {
68
- name: "TestClass",
69
- baseType: "Foo"
70
- });
71
- }
72
- })).toRenderTo(`
73
- class TestClass : Foo;
74
- `);
75
- });
76
- it("define multiple interface types", () => {
77
- expect(_$createComponent(utils.TestNamespace, {
78
- get children() {
79
- return _$createComponent(csharp.ClassDeclaration, {
80
- name: "TestClass",
81
- interfaceTypes: ["Foo", "Bar"]
82
- });
83
- }
84
- })).toRenderTo(`
85
- class TestClass : Foo, Bar;
86
- `);
87
- });
88
- it("define base class and multiple interface types", () => {
89
- expect(_$createComponent(utils.TestNamespace, {
90
- get children() {
91
- return _$createComponent(csharp.ClassDeclaration, {
92
- name: "TestClass",
93
- baseType: "BaseClass",
94
- interfaceTypes: ["Foo", "Bar"]
95
- });
96
- }
97
- })).toRenderTo(`
98
- class TestClass : BaseClass, Foo, Bar;
99
- `);
100
- });
101
- });
102
- it("declares class with some members", () => {
103
- const res = utils.toSourceText(_$createComponent(csharp.ClassDeclaration, {
104
- "public": true,
105
- name: "TestClass",
106
- get children() {
107
- return _$createComponent(core.StatementList, {
108
- get children() {
109
- return [_$createComponent(csharp.ClassMember, {
110
- "public": true,
111
- name: "MemberOne",
112
- type: "string"
113
- }), _$createComponent(csharp.ClassMember, {
114
- "private": true,
115
- name: "MemberTwo",
116
- type: "int"
117
- })];
118
- }
119
- });
120
- }
121
- }));
122
- expect(res).toBe(coretest.d`
123
- namespace TestCode
124
- {
125
- public class TestClass
126
- {
127
- public string MemberOne;
128
- private int memberTwo;
129
- }
130
- }
131
- `);
132
- });
133
- it("declares class with some methods", () => {
134
- const res = utils.toSourceText(_$createComponent(csharp.ClassDeclaration, {
135
- "public": true,
136
- name: "TestClass",
137
- get children() {
138
- return _$createComponent(core.List, {
139
- get children() {
140
- return [_$createComponent(csharp.ClassMethod, {
141
- "public": true,
142
- name: "MethodOne"
143
- }), _$createComponent(csharp.ClassMethod, {
144
- "private": true,
145
- virtual: true,
146
- name: "MethodTwo"
147
- })];
148
- }
149
- });
150
- }
151
- }));
152
- expect(res).toBe(coretest.d`
153
- namespace TestCode
154
- {
155
- public class TestClass
156
- {
157
- public void MethodOne() {}
158
- private virtual void MethodTwo() {}
159
- }
160
- }
161
- `);
162
- });
163
- it("uses refkeys for members, params, and return type", () => {
164
- const inputTypeRefkey = core.refkey();
165
- const testResultTypeRefkey = core.refkey();
166
- const enumTypeRefkey = core.refkey();
167
- const params = [{
168
- name: "IntParam",
169
- type: "int"
170
- }, {
171
- name: "BodyParam",
172
- type: inputTypeRefkey
173
- }];
174
- const res = core.render(_$createComponent(core.Output, {
175
- get namePolicy() {
176
- return csharp.createCSharpNamePolicy();
177
- },
178
- get children() {
179
- return _$createComponent(csharp.Namespace, {
180
- name: "TestCode",
181
- get children() {
182
- return _$createComponent(csharp.SourceFile, {
183
- path: "Test.cs",
184
- get children() {
185
- return [_$createComponent(csharp.EnumDeclaration, {
186
- "public": true,
187
- name: "TestEnum",
188
- refkey: enumTypeRefkey,
189
- get children() {
190
- return _$createComponent(core.List, {
191
- comma: true,
192
- hardline: true,
193
- get children() {
194
- return [_$createComponent(csharp.EnumMember, {
195
- name: "One"
196
- }), _$createComponent(csharp.EnumMember, {
197
- name: "Two"
198
- })];
199
- }
200
- });
201
- }
202
- }), _$createIntrinsic("hbr", {}), _$createComponent(csharp.ClassDeclaration, {
203
- "public": true,
204
- name: "TestInput",
205
- refkey: inputTypeRefkey
206
- }), _$createIntrinsic("hbr", {}), _$createComponent(csharp.ClassDeclaration, {
207
- "public": true,
208
- name: "TestResult",
209
- refkey: testResultTypeRefkey
210
- }), _$createIntrinsic("hbr", {}), _$createComponent(csharp.ClassDeclaration, {
211
- "public": true,
212
- name: "TestClass",
213
- get children() {
214
- return [_$createComponent(csharp.ClassMember, {
215
- "private": true,
216
- name: "MemberOne",
217
- type: enumTypeRefkey
218
- }), ";", _$createIntrinsic("hbr", {}), _$createComponent(csharp.ClassMethod, {
219
- "public": true,
220
- name: "MethodOne",
221
- parameters: params,
222
- returns: testResultTypeRefkey,
223
- get children() {
224
- return ["return new ", testResultTypeRefkey, "();"];
225
- }
226
- })];
227
- }
228
- })];
229
- }
230
- });
231
- }
232
- });
233
- }
234
- }));
235
- expect(res.contents[0].contents).toBe(coretest.d`
236
- namespace TestCode
237
- {
238
- public enum TestEnum
239
- {
240
- One,
241
- Two
242
- }
243
- public class TestInput;
244
- public class TestResult;
245
- public class TestClass
246
- {
247
- private TestEnum memberOne;
248
- public TestResult MethodOne(int intParam, TestInput bodyParam)
249
- {
250
- return new TestResult();
251
- }
252
- }
253
- }
254
- `);
255
- });
256
- describe("with type parameters", () => {
257
- it("reference parameters", () => {
258
- const typeParameters = [{
259
- name: "T",
260
- refkey: refkey()
261
- }, {
262
- name: "U",
263
- refkey: refkey()
264
- }];
265
- expect(_$createComponent(utils.TestNamespace, {
266
- get children() {
267
- return _$createComponent(SourceFile, {
268
- path: "Test.cs",
269
- get children() {
270
- return _$createComponent(ClassDeclaration, {
271
- "public": true,
272
- name: "TestClass",
273
- typeParameters: typeParameters,
274
- get children() {
275
- return _$createComponent(List, {
276
- get children() {
277
- return [_$createComponent(Property, {
278
- name: "PropA",
279
- get type() {
280
- return typeParameters[0].refkey;
281
- },
282
- get: true,
283
- set: true
284
- }), _$createComponent(Property, {
285
- name: "PropB",
286
- get type() {
287
- return typeParameters[1].refkey;
288
- },
289
- get: true,
290
- set: true
291
- })];
292
- }
293
- });
294
- }
295
- });
296
- }
297
- });
298
- }
299
- })).toRenderTo(`
300
- namespace TestCode
301
- {
302
- public class TestClass<T, U>
303
- {
304
- T PropA { get; set; }
305
- U PropB { get; set; }
306
- }
307
- }
308
- `);
309
- });
310
- it("defines with constraints", () => {
311
- const typeParameters = [{
312
- name: "T",
313
- constraints: "IFoo"
314
- }, {
315
- name: "U",
316
- constraints: "IBar"
317
- }];
318
- expect(_$createComponent(utils.TestNamespace, {
319
- get children() {
320
- return _$createComponent(ClassDeclaration, {
321
- "public": true,
322
- name: "TestClass",
323
- typeParameters: typeParameters,
324
- children: "// Body"
325
- });
326
- }
327
- })).toRenderTo(`
328
- public class TestClass<T, U>
329
- where T : IFoo
330
- where U : IBar
331
- {
332
- // Body
333
- }
334
- `);
335
- });
336
- });
337
- it("declares class with invalid members", () => {
338
- const decl = _$createComponent(csharp.ClassDeclaration, {
339
- "public": true,
340
- name: "TestClass",
341
- get children() {
342
- return [_$createComponent(csharp.EnumMember, {
343
- name: "One"
344
- }), ",", _$createIntrinsic("hbr", {}), _$createComponent(csharp.EnumMember, {
345
- name: "Two"
346
- })];
347
- }
348
- });
349
- expect(() => utils.toSourceText(decl)).toThrow("can't define an enum member outside of an enum-decl scope");
350
- });
351
- it("declares class with constructor", () => {
352
- const res = utils.toSourceText(_$createComponent(csharp.ClassDeclaration, {
353
- "public": true,
354
- name: "TestClass",
355
- get children() {
356
- return _$createComponent(csharp.ClassConstructor, {
357
- "public": true
358
- });
359
- }
360
- }));
361
- expect(res).toBe(coretest.d`
362
- namespace TestCode
363
- {
364
- public class TestClass
365
- {
366
- public TestClass() {}
367
- }
368
- }
369
- `);
370
- });
371
- it("declares class with constructor params and assigns values to fields", () => {
372
- const thisNameRefkey = core.refkey();
373
- const thisSizeRefkey = core.refkey();
374
- const paramNameRefkey = core.refkey();
375
- const paramSizeRefkey = core.refkey();
376
- const ctorParams = [{
377
- name: "name",
378
- type: "string",
379
- refkey: paramNameRefkey
380
- }, {
381
- name: "size",
382
- type: "int",
383
- refkey: paramSizeRefkey
384
- }];
385
- const res = utils.toSourceText(_$createComponent(csharp.ClassDeclaration, {
386
- "public": true,
387
- name: "TestClass",
388
- get children() {
389
- return [_$createComponent(csharp.ClassMember, {
390
- "private": true,
391
- name: "name",
392
- type: "string",
393
- refkey: thisNameRefkey
394
- }), ";", _$createIntrinsic("hbr", {}), _$createComponent(csharp.ClassMember, {
395
- "private": true,
396
- name: "size",
397
- type: "int",
398
- refkey: thisSizeRefkey
399
- }), ";", _$createIntrinsic("hbr", {}), _$createComponent(csharp.ClassConstructor, {
400
- "public": true,
401
- parameters: ctorParams,
402
- get children() {
403
- return [thisNameRefkey, " = ", paramNameRefkey, ";", _$createIntrinsic("hbr", {}), thisSizeRefkey, " = ", paramSizeRefkey, ";"];
404
- }
405
- })];
406
- }
407
- }));
408
-
409
- // TODO: assignments to members should have this. prefix
410
- // e.g. this.name = name;
411
- expect(res).toBe(coretest.d`
412
- namespace TestCode
413
- {
414
- public class TestClass
415
- {
416
- private string name;
417
- private int size;
418
- public TestClass(string name, int size)
419
- {
420
- name = name;
421
- size = size;
422
- }
423
- }
424
- }
425
- `);
426
- });
427
- it("specify doc comment", () => {
428
- expect(_$createComponent(utils.TestNamespace, {
429
- get children() {
430
- return _$createComponent(ClassDeclaration, {
431
- name: "Test",
432
- doc: "This is a test"
433
- });
434
- }
435
- })).toRenderTo(`
436
- /// This is a test
437
- class Test;
438
- `);
439
- });
440
- it("supports class member doc comments", () => {
441
- expect(_$createComponent(utils.TestNamespace, {
442
- get children() {
443
- return _$createComponent(ClassDeclaration, {
444
- name: "Test",
445
- doc: "This is a test",
446
- get children() {
447
- return _$createComponent(ClassMember, {
448
- name: "Member",
449
- "public": true,
450
- type: "int",
451
- doc: "This is a member"
452
- });
453
- }
454
- });
455
- }
456
- })).toRenderTo(`
457
- /// This is a test
458
- class Test
459
- {
460
- /// This is a member
461
- public int Member
462
- }
463
- `);
464
- });
465
- it("specify attributes", () => {
466
- expect(_$createComponent(utils.TestNamespace, {
467
- get children() {
468
- return _$createComponent(ClassDeclaration, {
469
- name: "Test",
470
- get attributes() {
471
- return [_$createComponent(Attribute, {
472
- name: "Test"
473
- })];
474
- }
475
- });
476
- }
477
- })).toRenderTo(`
478
- [Test]
479
- class Test;
480
- `);
481
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=project-directory.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"project-directory.test.d.ts","sourceRoot":"","sources":["../../test/project-directory.test.tsx"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import "@alloy-js/core/testing";
2
- //# sourceMappingURL=vitest.setup.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vitest.setup.d.ts","sourceRoot":"","sources":["../../test/vitest.setup.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC"}
@@ -1 +0,0 @@
1
- import "@alloy-js/core/testing";