( comp: IndexedComponent, kind: IdentifierKind, name: string, )
| 117 | } |
| 118 | |
| 119 | function getIdentifier<T extends TopLevelIdentifier = TopLevelIdentifier>( |
| 120 | comp: IndexedComponent, |
| 121 | kind: IdentifierKind, |
| 122 | name: string, |
| 123 | ): T { |
| 124 | const identifiers = Array.from(comp.template.identifiers); |
| 125 | const found = identifiers.find((id) => id.kind === kind && id.name === name); |
| 126 | expect(found).toBeDefined(); |
| 127 | return found as T; |
| 128 | } |
| 129 | |
| 130 | function getIdentifiers<T extends TopLevelIdentifier = TopLevelIdentifier>( |
| 131 | comp: IndexedComponent, |
no test coverage detected