title: jasmin: mock instance of a class
body: <p>Is it possible to create a mock of an object <strong>obj</strong> such that Jasmine test like </p>
  
  <pre><code>expect(fakeB instanceof B).toBe(true);
  </code></pre>
  
  <p>passes? </p>
  
  <p>In other words, I have a class <strong>A</strong> with a method <strong>convertToB</strong> which argument must be an instance of a class <strong>B</strong>: </p>
  
  <pre><code>function A(){
    this.convertToB = function(elem){
      if (!(elem instanceof B)){ throw an error}
      ...
      ... 
    }
  }
  </code></pre>
  
  <p>I would like to cover with test that piece of code by creating a mock object that when being asked whether it is an instance of <strong>B</strong> would respond <strong>true</strong>. </p>
  
  <p>For the moment I am forced to write tests kind of </p>
  
  <ol>
  <li><em>it('throws an error if the argument is a string')</em></li>
  <li><em>it('throws an error if the argument is an array')</em></li>
  <li>...</li>
  </ol>
  
  <p>which is a bit annoying. I expect a command like</p>
  
  <pre><code> var fakeB = jasmine.createFake('B')
  </code></pre>
  
  <p>so that the first line of code in this question would pass.</p>