Permalink
Browse files

[refactor minor] Prefer `fs.exists` to `path.exists` when available

  • Loading branch information...
indexzero committed Jul 8, 2012
1 parent a0fc098 commit 2322f1b6ac7c41bba7ba107c37598ff5a2623d2b
Showing with 4 additions and 2 deletions.
  1. +4 −2 test/log-exception-test.js
@@ -8,10 +8,12 @@
var assert = require('assert'),
path = require('path'),
+ fs = require('fs'),
spawn = require('child_process').spawn,
vows = require('vows'),
winston = require('../lib/winston'),
- helpers = require('./helpers');
+ helpers = require('./helpers'),
+ exists = (fs.exists || path.exists);
vows.describe('winston/logger/exceptions').addBatch({
"When using winston": {
@@ -46,7 +48,7 @@ vows.describe('winston/logger/exceptions').addBatch({
helpers.tryUnlink(exception);
child.on('exit', function () {
- path.exists(exception, that.callback.bind(this, null));
+ exists(exception, that.callback.bind(this, null));
});
},
"should not write to the specified error file": function (err, exists) {

0 comments on commit 2322f1b

Please sign in to comment.