Skip to content

Commit 928613a

Browse files
committed
Replace fs.exists with path-exists
1 parent 8a777c3 commit 928613a

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"devDependencies": {
3636
"ava": "^0.0.4",
3737
"nock": "^2.6.0",
38+
"path-exists": "^1.0.0",
3839
"rimraf": "^2.2.8"
3940
}
4041
}

test/test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ var fs = require('fs');
44
var path = require('path');
55
var BinWrapper = require('../');
66
var nock = require('nock');
7+
var pathExists = require('path-exists');
78
var rimraf = require('rimraf');
89
var test = require('ava');
910
var fixture = path.join.bind(path, __dirname, 'fixtures');
@@ -87,7 +88,7 @@ test('verify that a binary is working', function (t) {
8788

8889
bin.run(function (err) {
8990
t.assert(!err, err);
90-
t.assert(fs.existsSync(bin.path()));
91+
t.assert(pathExists.sync(bin.path()));
9192
t.assert(scope.isDone());
9293

9394
rimraf(bin.dest(), function (err) {
@@ -111,7 +112,7 @@ test('meet the desired version', function (t) {
111112

112113
bin.run(function (err) {
113114
t.assert(!err, err);
114-
t.assert(fs.existsSync(bin.path()));
115+
t.assert(pathExists.sync(bin.path()));
115116
t.assert(scope.isDone());
116117

117118
rimraf(bin.dest(), function (err) {
@@ -168,7 +169,7 @@ test('skip running binary check', function (t) {
168169

169170
bin.run(['--shouldNotFailAnyway'], function (err) {
170171
t.assert(!err, err);
171-
t.assert(fs.existsSync(bin.path()));
172+
t.assert(pathExists.sync(bin.path()));
172173
t.assert(scope.isDone());
173174

174175
rimraf(bin.dest(), function (err) {

0 commit comments

Comments
 (0)