Question

Karma has two runner modes in the browser: default and debug (/debug.html). There are differences in how the two modes operate. For example, in debug mode you can console.log objects with circular references. In default mode this generates a JSON circular reference error.

Is there a mechanism to detect which mode Karma is in from JS so that, for example, additional error logging is activated in debug mode?

Était-ce utile?

La solution

I think you kind of answered this yourself ...

var isDebug = !!document.URL.match(/debug\.html/)

Any reason this would not work for you?

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top