Skip to content

Commit b27d9b3

Browse files
ofrobotsstephenplusplus
authored andcommitted
logging-winston: avoid printing to console during test (googleapis#1985)
1 parent 1a31783 commit b27d9b3

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

packages/logging-winston/system-test/logging-winston.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,16 @@ var winston = require('winston');
2424
var env = require('../../../system-test/env.js');
2525

2626
var logging = require('@google-cloud/logging')(env);
27-
var loggingWinston = require('../');
27+
var LoggingWinston = require('../');
2828

2929
describe('LoggingWinston', function() {
3030
var WRITE_CONSISTENCY_DELAY_MS = 20000;
3131

32-
winston.add(loggingWinston, env);
32+
var logger = new winston.Logger({
33+
transports: [
34+
new LoggingWinston(env)
35+
]
36+
});
3337

3438
describe('log', function() {
3539
var testTimestamp = new Date();
@@ -69,7 +73,7 @@ describe('LoggingWinston', function() {
6973

7074
it('should properly write log entries', function(done) {
7175
async.each(testData, function(test, callback) {
72-
winston.info.apply(winston, test.args.concat(callback));
76+
logger.info.apply(logger, test.args.concat(callback));
7377
}, function(err) {
7478
assert.ifError(err);
7579

0 commit comments

Comments
 (0)