Check if test is running Karma


To check if your JavaScript test is running Karma, verify that window.__karma__ exists:

function isKarma() {
  return typeof window === 'object' && typeof window.__karma__ === 'object';
}


Please support this site and join our Discord!