Skip to content
代码片段 群组 项目
  • Eduardo Sanz García's avatar
    a6e11501
    Replace `not.toBeEmpty` in test · a6e11501
    Eduardo Sanz García 创作于
    `#toBeEmpty` is imported from JQuery and the matcher tests `:empty`
    pseudo class. Hence, these expectation doesn't work:
    
    * expect([]).not.toBeEmpty() should fail, but it succeeds
    * expect({}).not.toBeEmpty() should fail, but it succeeds
    
    We disallow `#toBeEmpty` in tests and substitute their usage for
    alternative approaches:
    
    * expect([].length).toBe(0)
    * expect([1].length).toBeGreaterThan(0)
    a6e11501
    历史
    Replace `not.toBeEmpty` in test
    Eduardo Sanz García 创作于
    `#toBeEmpty` is imported from JQuery and the matcher tests `:empty`
    pseudo class. Hence, these expectation doesn't work:
    
    * expect([]).not.toBeEmpty() should fail, but it succeeds
    * expect({}).not.toBeEmpty() should fail, but it succeeds
    
    We disallow `#toBeEmpty` in tests and substitute their usage for
    alternative approaches:
    
    * expect([].length).toBe(0)
    * expect([1].length).toBeGreaterThan(0)
代码所有者
将用户和群组指定为特定文件更改的核准人。 了解更多。