From 5634954b7e5ad9150994c6ea3a20cc573222f4a4 Mon Sep 17 00:00:00 2001 From: Jonas Hermsmeier Date: Thu, 8 Feb 2018 18:43:48 +0100 Subject: [PATCH] refactor(test): Remove dependency on `tmp` This removes the dependence on `tmp`, as this module has been known to cause problems, while also being unnecessary for what it's being used for. Change-Type: minor --- npm-shrinkwrap.json | 5 ----- package.json | 1 - tests/image-stream/tester.js | 5 +++-- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 7fcbdcaf..70aec85a 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -6115,11 +6115,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz" }, - "tmp": { - "version": "0.0.31", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.31.tgz", - "dev": true - }, "to-file": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/to-file/-/to-file-0.2.0.tgz", diff --git a/package.json b/package.json index c48b435a..9a5fbc1d 100644 --- a/package.json +++ b/package.json @@ -116,7 +116,6 @@ "pkg": "4.1.1", "sass-lint": "1.10.2", "spectron": "3.7.2", - "tmp": "0.0.31", "versionist": "2.8.1" } } diff --git a/tests/image-stream/tester.js b/tests/image-stream/tester.js index bb6be48c..c280116b 100644 --- a/tests/image-stream/tester.js +++ b/tests/image-stream/tester.js @@ -21,7 +21,8 @@ const _ = require('lodash') const Bluebird = require('bluebird') const fileExists = require('file-exists') const fs = Bluebird.promisifyAll(require('fs')) -const tmp = require('tmp') +const os = require('os') +const path = require('path') const imageStream = require('../../lib/image-stream/index') const doFilesContainTheSameData = (file1, file2) => { @@ -61,7 +62,7 @@ exports.expectError = function (file, errorMessage, errorDetail) { exports.extractFromFilePath = function (file, image) { it('should be able to extract the image', function () { - const output = tmp.tmpNameSync() + const output = path.join(os.tmpdir(), path.basename(file)) return imageStream.getFromFilePath(file).then(function (results) { m.chai.expect(results.path).to.equal(file)