jeudi 27 octobre 2016

Testing: spyOn new Object in Class Constructor

I have a React component as such:

class Entity extends React.component{
  constructor(props{
  ...
  const foo = new Bar(...);
  }
  ...
}
module.exports = Entity;

I am now using Jasmine 2.5 to write tests for this module, and I am wondering how to test that the foo object is created.

Aucun commentaire:

Enregistrer un commentaire