Skip to content

Commit

Permalink
tests: use temp-path for paths
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Apr 13, 2017
1 parent ca3ce4e commit 08135aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"eslint-plugin-standard": "2.1.1",
"istanbul": "0.4.5",
"mocha": "2.5.3",
"supertest": "1.1.0"
"supertest": "1.1.0",
"temp-path": "1.0.0"
},
"files": [
"LICENSE",
Expand Down
9 changes: 1 addition & 8 deletions test/support/tempIcon.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@

var crypto = require('crypto')
var fs = require('fs')
var os = require('os')
var path = require('path')
var tmpdir = os.tmpdir || os.tmpDir
var tempPath = require('temp-path')

module.exports = TempIcon

Expand All @@ -28,8 +26,3 @@ TempIcon.prototype.writeSync = function writeSync () {
this.exists = true
}
}

function tempPath () {
var fileName = 'favicon-' + (Date.now() + Math.random()) + '.ico'
return path.join(tmpdir(), fileName)
}

0 comments on commit 08135aa

Please sign in to comment.