(instance: TestInstance | string | null)
| 1 | import type { TestInstance } from 'test-renderer'; |
| 2 | |
| 3 | export function getTextContent(instance: TestInstance | string | null): string { |
| 4 | if (!instance) { |
| 5 | return ''; |
| 6 | } |
| 7 | |
| 8 | if (typeof instance === 'string') { |
| 9 | return instance; |
| 10 | } |
| 11 | |
| 12 | const result: string[] = []; |
| 13 | instance.children?.forEach((child) => { |
| 14 | result.push(getTextContent(child)); |
| 15 | }); |
| 16 | |
| 17 | return result.join(''); |
| 18 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…