-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-parser-enhancements.ts
More file actions
78 lines (62 loc) · 1.84 KB
/
test-parser-enhancements.ts
File metadata and controls
78 lines (62 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// Test file for TypeScript parser enhancements
// This file tests the new type/interface indexing and test file symbol recognition
// Test 1: Type alias declarations (Priority 1.1)
type SymbolKind = 'function' | 'class' | 'method' | 'type' | 'interface' | 'test';
type Result<T> = { success: boolean; data: T };
type EventHandler = (event: Event) => void;
// Test 2: Interface declarations (Priority 1.1)
interface MyInterface {
name: string;
method(): void;
}
interface ExtendedInterface extends MyInterface {
additionalProperty: number;
}
interface GenericInterface<T> {
value: T;
getValue(): T;
}
// Test 3: Test file symbol recognition (Priority 1.2)
describe('TypeScript Parser Enhancements', () => {
test('should index type aliases', () => {
expect(true).toBe(true);
});
test('should index interface declarations', () => {
expect(true).toBe(true);
});
test('should recognize test() calls as symbols', () => {
expect(true).toBe(true);
});
test('should recognize describe() calls as symbols', () => {
expect(true).toBe(true);
});
test('complex test name with special characters', () => {
expect(true).toBe(true);
});
});
// Test 4: Traditional function declarations (existing functionality)
function traditionalFunction(param: string): void {
console.log(param);
}
// Test 5: Class declarations (existing functionality)
class MyClass implements MyInterface {
name: string = 'test';
method(): void {
console.log(this.name);
}
getValue<T>(): T {
return {} as T;
}
}
// Test 6: Variable declarations (existing functionality)
const myVariable = 42;
let myVariable2 = 'test';
// Test 7: Method definitions (existing functionality)
class WithMethod {
publicMethod(): void {
console.log('public method');
}
private _privateMethod(): void {
console.log('private method');
}
}