mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-23 03:06:38 +00:00
Merge pull request #2027 from resin-io/remove-tmp
refactor(test): Remove dependency on `tmp`
This commit is contained in:
commit
56b0f13525
5
npm-shrinkwrap.json
generated
5
npm-shrinkwrap.json
generated
@ -6115,11 +6115,6 @@
|
|||||||
"version": "4.0.1",
|
"version": "4.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz"
|
"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": {
|
"to-file": {
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/to-file/-/to-file-0.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/to-file/-/to-file-0.2.0.tgz",
|
||||||
|
@ -116,7 +116,6 @@
|
|||||||
"pkg": "4.1.1",
|
"pkg": "4.1.1",
|
||||||
"sass-lint": "1.10.2",
|
"sass-lint": "1.10.2",
|
||||||
"spectron": "3.7.2",
|
"spectron": "3.7.2",
|
||||||
"tmp": "0.0.31",
|
|
||||||
"versionist": "2.8.1"
|
"versionist": "2.8.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,8 @@ const _ = require('lodash')
|
|||||||
const Bluebird = require('bluebird')
|
const Bluebird = require('bluebird')
|
||||||
const fileExists = require('file-exists')
|
const fileExists = require('file-exists')
|
||||||
const fs = Bluebird.promisifyAll(require('fs'))
|
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 imageStream = require('../../lib/image-stream/index')
|
||||||
|
|
||||||
const doFilesContainTheSameData = (file1, file2) => {
|
const doFilesContainTheSameData = (file1, file2) => {
|
||||||
@ -61,7 +62,7 @@ exports.expectError = function (file, errorMessage, errorDetail) {
|
|||||||
|
|
||||||
exports.extractFromFilePath = function (file, image) {
|
exports.extractFromFilePath = function (file, image) {
|
||||||
it('should be able to extract the image', function () {
|
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) {
|
return imageStream.getFromFilePath(file).then(function (results) {
|
||||||
m.chai.expect(results.path).to.equal(file)
|
m.chai.expect(results.path).to.equal(file)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user