Skip to content

Commit

Permalink
[test fix] Don't error out on Loggly tests with no config
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalecki committed Nov 18, 2011
1 parent 184c3bd commit f89de80
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions test/helpers.js
Expand Up @@ -28,8 +28,8 @@ helpers.loadConfig = function (dir) {
return config;
}
catch (ex) {
util.puts('test/fixtures/test-config.json must be created with valid data before running tests');
process.exit(0);
console.error('test/fixtures/test-config.json must be created with valid data before running tests');
return false;
}
};

Expand Down
12 changes: 9 additions & 3 deletions test/transports/loggly-test.js
Expand Up @@ -12,8 +12,13 @@ var path = require('path'),
winston = require('../../lib/winston'),
helpers = require('../helpers');

var config = helpers.loadConfig(),
tokenTransport = new (winston.transports.Loggly)({
var config = helpers.loadConfig();

if (!config) {
return;
}

var tokenTransport = new (winston.transports.Loggly)({
subdomain: config.transports.loggly.subdomain,
inputToken: config.transports.loggly.inputToken
}),
Expand Down Expand Up @@ -52,4 +57,5 @@ vows.describe('winston/transports/loggly').addBatch({
})
}
}
}).export(module);
}).export(module);

0 comments on commit f89de80

Please sign in to comment.