title: Jasmine toBeUndefined
body: <p>I'm new to Jasmine and assumed using the <code>.not.toBeDefined()</code> or <code>.toBeUndefined()</code> matches you could check if a variable is <code>undefined</code>:</p>
  
  <pre><code>describe('toBeDefined', function() {
  
      it('should be defined', function() {
          var obj = {};
          expect(obj).toBeDefined(); // Passes
      });
  
      it('should not be defined using .not.tobeDefined()', function() {
          //var obj = {};
          expect(obj).not.toBeDefined(); // Fails // ReferenceError: obj is not defined
      });
  
      it('should not be defined using .tobeUnefined()', function() {
          //var obj = {};
          expect(obj).toBeUndefined(); // Fails // ReferenceError: obj is not defined
      });
  
  });
  </code></pre>
  
  <p>I completely get that this would fail within the code, but I assumed using those matches, it wouldn't. Am I just using these wrong, or is it not possible to write a spec to check if something is <code>undefined</code>?</p>