Merge pull request #2027 from resin-io/remove-tmp

refactor(test): Remove dependency on `tmp`
This commit is contained in:
Jonas Hermsmeier 2018-02-08 10:33:06 -08:00 committed by GitHub
commit 56b0f13525
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 8 deletions

5
npm-shrinkwrap.json generated
View File

@ -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",

View File

@ -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"
}
}

View File

@ -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)