Skip to content

Commit

Permalink
Reduce the amount of console "spam", by ignoring info/warn calls,…
Browse files Browse the repository at this point in the history
… when running the unit-tests in Node.js/Travis

Compared to running the unit-tests in "regular" browsers, where any console output won't get mixed up with test output, in Node.js/Travis the test output looks quite noisy.
By ignoring `info`/`warn` calls, when running unit-tests in Node.js/Travis, the test output is a lot smaller not to mention that any *actual* failures are more easily spotted.
  • Loading branch information
Snuffleupagus committed Jun 2, 2018
1 parent ef081a0 commit 11b4613
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/unit/clitests_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* limitations under the License.
*/

import { setVerbosityLevel, VerbosityLevel } from '../../src/shared/util';
import isNodeJS from '../../src/shared/is_node';
import { PDFNodeStream } from '../../src/display/node_stream';
import { setPDFNetworkStreamFactory } from '../../src/display/api';
Expand All @@ -23,6 +24,10 @@ if (!isNodeJS()) {
'Node.js environments.');
}

// Reduce the amount of console "spam", by ignoring `info`/`warn` calls,
// when running the unit-tests in Node.js/Travis.
setVerbosityLevel(VerbosityLevel.ERRORS);

// Set the network stream factory for the unit-tests.
setPDFNetworkStreamFactory(function(params) {
return new PDFNodeStream(params);
Expand Down

0 comments on commit 11b4613

Please sign in to comment.