jasmine-jquery
jasmine-jquery copied to clipboard
toBeEmpty() matcher inconsistent behavior
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
})
})