(options?: { hasError?: boolean; throwOnDescendants?: boolean })
| 40 | }); |
| 41 | |
| 42 | function fakeTree(options?: { hasError?: boolean; throwOnDescendants?: boolean }) { |
| 43 | const deleteSpy = vi.fn(); |
| 44 | const shouldThrow = Boolean(options?.throwOnDescendants); |
| 45 | |
| 46 | return { |
| 47 | rootNode: { |
| 48 | hasError: Boolean(options?.hasError), |
| 49 | descendantsOfType: vi.fn(() => { |
| 50 | if (shouldThrow) { |
| 51 | throw new Error('forced descendants failure'); |
| 52 | } |
| 53 | return []; |
| 54 | }) |
| 55 | }, |
| 56 | delete: deleteSpy |
| 57 | }; |
| 58 | } |
| 59 | |
| 60 | describe('Tree-sitter cleanup and parser reset regressions', () => { |
| 61 | beforeEach(() => { |
no outgoing calls
no test coverage detected