A global registry of Testability instances for specific elements.
API
class TestabilityRegistry {
registerApplication(token: any, testability: Testability): void;
unregisterApplication(token: any): void;
unregisterAllApplications(): void;
getTestability(elem: any): Testability | null;
getAllTestabilities(): Testability[];
getAllRootElements(): any[];
findTestabilityInTree(elem: Node, findInAncestors?: boolean): Testability | null;
}
registerApplication
voidRegisters an application with a testability hook so that it can be tracked
@paramtoken
anytoken of application, root element
@returns
void
unregisterApplication
voidUnregisters an application.
@paramtoken
anytoken of application, root element
@returns
void
unregisterAllApplications
voidUnregisters all applications
@returns
void
getTestability
Testability | nullGet a testability hook associated with the application
@paramelem
anyroot element
@returns
Testability | null
getAllTestabilities
Testability[]Get all registered testabilities
@returns
Testability[]
getAllRootElements
any[]Get all registered applications(root elements)
@returns
any[]
findTestabilityInTree
Testability | nullFind testability of a node in the Tree
@paramelem
Nodenode
@paramfindInAncestors
booleanwhether finding testability in ancestors if testability was not found in current node
@returns
Testability | null