Consider switching this to an early out instead, i.e. 
if (typeof jasmine === "undefined" || typeof beforeEach === "undefined")
  return;
...