Debug Browser Javascript Tests
Explore methods to debug Jasmine tests running in browser environments. Learn to capture console logs with custom reporters, use browser developer tools for live debugging, set breakpoints, and understand asynchronous log behaviors to improve your JavaScript testing process.
Using ‘console.log’
At the time of writing of this course, using jasmine-browser-runner runSpecs doesn’t output the instances of console.log to the terminal (the Node.js process) because the tests execute in the browser environment. We can see these logs in the browser’s console part of the developer tools. If that browser is headless, then there’s no chance to see the logs.
There is a way to set up a reporter for the jasmine-browser-runner so that the logs show on the terminal. It’s based on this ...