Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

toBeEmpty() matcher inconsistent behavior #289

Open
aletheia opened this issue Sep 16, 2016 · 0 comments
Open

toBeEmpty() matcher inconsistent behavior #289

aletheia opened this issue Sep 16, 2016 · 0 comments

Comments

@aletheia
Copy link

toBeEmpty fails when checked object is not defined, but matcher when used in with .not does not fail if checked node is undefined.

  describe("toBeEmpty() bug with undefined", function() {
    it("works correctly when requiring being empty", function() {
    expect(undefined).toBeEmpty() // this fails with message "undefined is not empty"
  })

  it("behaves unexpectedly when using .not", function() {
    expect(undefined).not.toBeEmpty() // this does not fail
  })
})
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant