I am facing this same issue with ‘toBeDefined’ and ‘toBeUndefined’ and still don’t get why …
Melkis
41

It is not hard for jasmine to go through huge objects. The problem here is to log it onto the console. For example; when you test something like `expect(12345).toBe(54321)`, jasmine will display something like following “expected 12345 to be 54321”. So, when you compare a huge object to “undefined” it tries to write “expected <huge object> to be undefined” at this point, browser crashes. On the other hand, `expect(hugeObject).toBeDefined()` works just fine because if your object is `undefined` it’ll just say “expected undefined to be defined”. If it is a defined object, then test will pass and everyone will be happy. Hope this clarifies the problem.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.