You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it('should return undefined for class JSDoc when no JSDoc exists',()=>{
14
+
constast=tsquery.ast(`
15
+
export class MyTestClass {
16
+
public myExplicitMethod(foo: string, bar: boolean): string {
17
+
}
18
+
}
19
+
`);
20
+
21
+
expect(parseClassJsDoc(ast)).toBeUndefined();
22
+
});
23
+
24
+
it('should parse JSDoc comments for class declarations',()=>{
25
+
constast=tsquery.ast(`
26
+
/**
27
+
* This is a JSDoc comment for MyTestClass
28
+
* @description A test class
29
+
* @example
30
+
* const myClass = new MyTestClass();
31
+
*/
32
+
export class MyTestClass {
33
+
public myExplicitMethod(foo: string, bar: boolean): string {
34
+
return 'test';
35
+
}
36
+
}
37
+
`);
38
+
39
+
expect(parseClassJsDoc(ast)).toEqual('This is a JSDoc comment for MyTestClass\n@description A test class\n@example const myClass = new MyTestClass();');
40
+
});
41
+
42
+
it('should parse JSDoc comments with multiple tags',()=>{
43
+
constast=tsquery.ast(`
44
+
/**
45
+
* This is a JSDoc comment for MyTestClass
46
+
* @description A test class
47
+
* @deprecated Use NewTestClass instead
48
+
* @since 1.0.0
49
+
*/
50
+
export class MyTestClass {
51
+
public myExplicitMethod(foo: string, bar: boolean): string {
52
+
return 'test';
53
+
}
54
+
}
55
+
`);
56
+
57
+
expect(parseClassJsDoc(ast)).toEqual('This is a JSDoc comment for MyTestClass\n@description A test class\n@deprecated Use NewTestClass instead\n@since 1.0.0');
0 commit comments