title: Qunit test property exists in object
body: <p>I am using <code>Qunit</code> testing engine in JavaScript and I need to check if a property exists in an object.</p>
  
  <p>Here is my setup:</p>
  
  <pre><code> var tests = [
      {
          foo: 'foo',
          bar: 'bar',
          expected: {}
      },
      {
          foo: '',
          bar: '',
          expected: //I need to expect foo and bar properties to exist
      }
   ]
  
   for(var i = 0; i &lt; tests.length; i++) {
      assert.deepEqual(validate_foo(tests[i]), tests[i].expected);
   }
  </code></pre>
  
  <p>The function <code>validate_foo()</code> either will return an empty object <code>{}</code> on success, or an object with the properties of each error. For example, <code>validate_foo()</code> expectes <code>foo</code> to equal <code>foo</code> and <code>bar</code> to equal <code>bar</code>. So in the second test, the result is:</p>
  
  <pre><code>{
      foo: 'foo does not equal foo',
      bar: 'bar does not equal bar'
  }
  </code></pre>
  
  <p>How do I write a test to accomblish this?</p>