When I run a unit test using intern, it writes console.log to the standard output, which is useful when developing the tests.
However, functional tests apparently suppress output - writing to console.log does not do anything, and I can not find any way to output text to the console. Which means when something goes wrong, it is very difficult to find out why.
Where
console.log
outputs text depends on what environment the tests are running in. When you runintern-client
, which only runs unit tests, the test code always runs in the Node.js environment andconsole.log
writes to stdout in the terminal.When you run
intern-runner
, unit tests run in the browser while functional tests run in Node.js. This means thatconsole.log
statements in the unit tests (those specified in thesuites
property of the intern config) will not print to stdout in the terminal, but instead will be output in the browser's console. Log statements in functional tests (those specified infunctionalSuites
) will be output to the terminal's stdout. The exception is log statements inexecute
orexecuteAsync
blocks, which will be output to the browser's console since code in those blocks will actually be executed in the browser.