diff --git a/package-lock.json b/package-lock.json index 2e4c0aa..cf302c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,8 +12,7 @@ "agent-base": "^6.0.2", "https-proxy-agent": "^5.0.1", "is-running": "^2.1.0", - "ps-tree": "=1.2.0", - "temp-fs": "^0.9.9" + "ps-tree": "=1.2.0" }, "devDependencies": { "eslint": "^7.0.0", @@ -2394,28 +2393,6 @@ "node": ">=8" } }, - "node_modules/temp-fs": { - "version": "0.9.9", - "resolved": "https://registry.npmjs.org/temp-fs/-/temp-fs-0.9.9.tgz", - "integrity": "sha1-gHFzBDeHByDpQxUy/igUNk+IA9c=", - "dependencies": { - "rimraf": "~2.5.2" - }, - "engines": { - "node": ">=0.8.0" - } - }, - "node_modules/temp-fs/node_modules/rimraf": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", - "integrity": "sha1-loAAk8vxoMhr2VtGJUZ1NcKd+gQ=", - "dependencies": { - "glob": "^7.0.5" - }, - "bin": { - "rimraf": "bin.js" - } - }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -4436,24 +4413,6 @@ } } }, - "temp-fs": { - "version": "0.9.9", - "resolved": "https://registry.npmjs.org/temp-fs/-/temp-fs-0.9.9.tgz", - "integrity": "sha1-gHFzBDeHByDpQxUy/igUNk+IA9c=", - "requires": { - "rimraf": "~2.5.2" - }, - "dependencies": { - "rimraf": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", - "integrity": "sha1-loAAk8vxoMhr2VtGJUZ1NcKd+gQ=", - "requires": { - "glob": "^7.0.5" - } - } - } - }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", diff --git a/package.json b/package.json index af3b118..97c77f6 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,6 @@ "https-proxy-agent": "^5.0.1", "is-running": "^2.1.0", "ps-tree": "=1.2.0", - "temp-fs": "^0.9.9", "agent-base": "^6.0.2" }, "devDependencies": { diff --git a/test/local.js b/test/local.js index 79c10eb..2802422 100644 --- a/test/local.js +++ b/test/local.js @@ -3,9 +3,9 @@ var expect = require('expect.js'), mocks = require('mocks'), path = require('path'), fs = require('fs'), + os = require('os'), rimraf = require('rimraf'), Proxy = require('proxy'), - tempfs = require('temp-fs'), browserstack = require('../index'), LocalBinary = require('../lib/LocalBinary'); @@ -270,7 +270,7 @@ describe('Start sync', () => { describe('LocalBinary', function () { describe('Retries', function() { - var unlinkTmp, + var tempDir, defaultBinaryPath, validBinaryPath, sandBox; @@ -282,18 +282,11 @@ describe('LocalBinary', function () { // removeIfInvalid(); (new LocalBinary()).binaryPath({}, 'abc', 9, function(binaryPath) { defaultBinaryPath = binaryPath; - tempfs.mkdir({ - recursive: true - }, function(err, dir) { + tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'browserstack-test-')); + validBinaryPath = path.join(tempDir, path.basename(binaryPath)); + fs.rename(defaultBinaryPath, validBinaryPath, function(err) { if(err) { throw err; } - - validBinaryPath = path.join(dir.path, path.basename(binaryPath)); - fs.rename(defaultBinaryPath, validBinaryPath, function(err) { - if(err) { throw err; } - - unlinkTmp = dir.unlink; - done(); - }); + done(); }); }); }); @@ -347,7 +340,7 @@ describe('LocalBinary', function () { fs.rename(validBinaryPath, defaultBinaryPath, function(err) { if(err) { throw err; } - unlinkTmp(done); + rimraf(tempDir, done); }); }); });