Question

While running tests in a shell, I was surprised to observe that calls to console.log() from external .js files are squashed even if -o/--release-console is specified. According to the documentation, the shell utility buster-test is supposed to leave the global console alone with that option specified.

In my previous experiences with JUnit and PyUnit, printing to stdout would produce output (on stdout or stderr) when the test cases are run in a shell, regardless of where "echo" was called. I prefer and need this behavior because I use logging/printing as the primary tool to understand what's going on.

What are my options if I want to reclaim console.log output in the terminal?


Details, updates:

  • The test is configured with a browser environment.

No correct solution

OTHER TIPS

You are harboring a misconception about the architecture of this setup. In particular, console.log in the browser (e.g Firefox) has nothing to do with console.log in the test-runner (Node) as evidenced by the screen-shot below. The fact that you are running in a browser environment is indeed relevant, as you might have suspected.

I'm not very experienced with BusterJS or Node, but in order to have all console.log output appear in the shell, you will need to run the tests in the node environment. This poses an obstacle because you need a Node module to take care of the DOM and other common dependencies such as jQuery.

var config = module.exports;
config["Interval Buttons"] = {
    environment: 'node',
};

Firebug console has your output:

console.log in the browser

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top