Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit d51fba8

Browse files
richardschneiderdaviddias
authored andcommitted
test: use os.tmpdir() (#178)
* test: use os.tmpdir() * test: use hat() for a unique name
1 parent db2152f commit d51fba8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/swarm.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ const expect = chai.expect
99
chai.use(dirtyChai)
1010
const series = require('async/series')
1111
const multiaddr = require('multiaddr')
12+
const os = require('os')
13+
const path = require('path')
14+
const hat = require('hat')
1215

1316
module.exports = (common) => {
1417
describe('.swarm', function () {
@@ -125,7 +128,7 @@ module.exports = (common) => {
125128
}
126129

127130
function getRepoPath () {
128-
return '/tmp/.ipfs-' + Math.random().toString().substring(2, 8) + Date.now()
131+
return path.join(os.tmpdir(), '.ipfs-' + hat())
129132
}
130133

131134
it('Connecting two peers with one address each', (done) => {

0 commit comments

Comments
 (0)