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

test: use os.tmpdir() #178

Merged
merged 2 commits into from
Dec 5, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/swarm.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ const expect = chai.expect
chai.use(dirtyChai)
const series = require('async/series')
const multiaddr = require('multiaddr')
const os = require('os')
const path = require('path')
const hat = require('hat')

module.exports = (common) => {
describe('.swarm', function () {
Expand Down Expand Up @@ -125,7 +128,7 @@ module.exports = (common) => {
}

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

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