When I run angular unit tests with Karma, the output contains:
The Karma output does not contain:
Is it possible for me to choose the logging "intensity"?
I would like to differentiate between:
Default mode: only display Karma reporter output, but suppress all application logging messages or unit test logging messages.
Unit test debugging mode: display Karma reporter output plus all logging messages (application log messages as well as unit test log messages).
Is it possible to log unit test message in a way so that it can be easily "switched" on and off, to select one of the the use cases above (Default mode vs. Unit test debugging mode)?
My "idea" would be something like that:
Default mode:
karma --log-level=none
Unit test debugging mode:
karma --log-level=debug
Is this possible?
Launch Event Viewer. Select View\Show Analytic and Debug Logs. Navigate to Event Viewer (Local)\Applications and Service Logs\Microsoft\User Experience Virtualization\App Agent. Right-click on Debug under App Agent and select Enable Log.
A debug log can record database operations, system processes, and errors that occur when executing a transaction or running unit tests. Debug logs can contain information about: Database changes.
The Jasmine test runner is just another web page made with HTML, CSS and JavaScript. This means you can debug it in the browser using the developer tools. Focus the browser window and open the developer tools. In Chrome, Firefox and Edge, you can use the F12 key.
You can create base karma config. Than create two karma config based on base but with overwritten logLevel:
logLevel: config.LOG_DISABLE
logLevel: config.LOG_DEBUG
.
Then create two separate tasks in your task manager config file, for instance Gruntfile.js
using those karma configs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With