填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写Home

TestabilityRegistry

实例的全局注册表,用于特定元素。

A global registry of Testabilityinstances for specific elements.

Testability
      
      class TestabilityRegistry {
  registerApplication(token: any, testability: Testability)
  unregisterApplication(token: any)
  unregisterAllApplications()
  getTestability(elem: any): Testability | null
  getAllTestabilities(): Testability[]
  getAllRootElements(): any[]
  findTestabilityInTree(elem: Node, findInAncestors: boolean = true): Testability | null
}
    

方法

使用 Testability 钩子注册应用程序,以便可以对其进行跟踪

Registers an application with a testability hook so that it can be tracked

      
      registerApplication(token: any, testability: Testability)
    
参数
token any

应用令牌,根元素

token of application, root element

testability Testability

Testability 钩子

Testability hook

注销应用程序。

Unregisters an application.

      
      unregisterApplication(token: any)
    
参数
token any

应用令牌,根元素

token of application, root element

注销所有应用程序

Unregisters all applications

      
      unregisterAllApplications()
    
参数

没有参数。

获取与应用程序关联的 Testability 钩子

Get a testability hook associated with the application

      
      getTestability(elem: any): Testability | null
    
参数
elem any

根元素

root element

返回值

Testability | null

获取所有注册的测试能力

Get all registered testabilities

      
      getAllTestabilities(): Testability[]
    
参数

没有参数。

返回值

Testability[]

获取所有注册的应用程序(根元素)

Get all registered applications(root elements)

      
      getAllRootElements(): any[]
    
参数

没有参数。

返回值

any[]

在树中查找节点的 Testability

Find testability of a node in the Tree

      
      findTestabilityInTree(elem: Node, findInAncestors: boolean = true): Testability | null
    
参数
elem Node

节点

node

findInAncestors boolean

在当前节点中未找到 Testability 的情况下是否要在祖先中寻找 Testability

whether finding testability in ancestors if testability was not found in current node

可选. 默认值是 `true`.
返回值

Testability | null