Skip to content

Commit

Permalink
feat: then-fs -> promise-fs
Browse files Browse the repository at this point in the history
then-fs seems to be causing a memory leak in jest in other tools.

Found by jestjs/jest#8331
  • Loading branch information
FauxFaux committed Jul 18, 2020
1 parent c89e9bc commit eab91b3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/index.js
@@ -1,7 +1,7 @@
module.exports = resolvePkg;
module.exports.sync = sync;

var fs = require('then-fs');
var fs = require('promise-fs');
var path = require('path');
var debug = require('debug')('snyk:resolve');

Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -16,7 +16,7 @@
"license": "Apache-2.0",
"dependencies": {
"debug": "^4.1.1",
"then-fs": "^2.0.0"
"promise-fs": "^2.1.1"
},
"devDependencies": {
"es6-promise": "^4.2.8",
Expand Down
4 changes: 2 additions & 2 deletions test/index.test.js
Expand Up @@ -31,7 +31,7 @@ var fs = {
};

var resolve = proxyquire('../lib/index', {
'then-fs': fs,
'promise-fs': fs,
});

test('resolve immediately', function (t) {
Expand Down Expand Up @@ -140,4 +140,4 @@ test('resolve works with scoped packages', function (t) {
});

t.equal(resolve.sync('@remy/foo', base), path.dirname(target), 'sync scoped matches');
});
});

0 comments on commit eab91b3

Please sign in to comment.