Reduce the amount of console "spam", by ignoring info/warn calls, 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.
This commit is contained in:
Jonas Jenwald 2018-06-01 12:56:46 +02:00
parent ef081a0531
commit 11b4613e20

View File

@ -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';
@ -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);