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

test: use os.tmpdir() #12

Merged
merged 2 commits into from
Dec 5, 2017
Merged

test: use os.tmpdir() #12

merged 2 commits into from
Dec 5, 2017

Conversation

richardschneider
Copy link
Contributor


module.exports = function createTempRepo (repoPath) {
repoPath = repoPath || '/tmp/ipfs-test-' + Math.random().toString().substring(2, 8)
repoPath = repoPath || path.join(os.tmpdir(), 'ipfs-test-' + Math.random().toString().substring(2, 8))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also replace this Math.random() mumbo jumbo by just using hat()

const hat = require('hat')
// ...
repoPath = repoPath || path.join(os.tmpdir(), 'ipfs-test-' + hat())

@daviddias daviddias merged commit d8542a8 into master Dec 5, 2017
@daviddias daviddias deleted the tmpdir branch December 5, 2017 08:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants