Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix: copy repo for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dryajov committed Feb 27, 2018
1 parent d16727d commit 540e5f6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions test/http-api/config.js
Expand Up @@ -18,7 +18,7 @@ const df = DaemonFactory.create({ exec: 'src/cli/bin.js' })

describe('config endpoint', () => {
const repoExample = path.join(__dirname, '../fixtures/go-ipfs-repo')
const repoTests = path.join(__dirname, '../repo-tests-run')
const repoPath = path.join(__dirname, '../repo-tests-run')

let updatedConfig = null

Expand All @@ -27,12 +27,12 @@ describe('config endpoint', () => {
before(function (done) {
this.timeout(20 * 1000)

ncp(repoExample, repoTests, (err) => {
ncp(repoExample, repoPath, (err) => {
expect(err).to.not.exist()

waterfall([
(cb) => df.spawn({
repoPath: repoTests,
repoPath: repoPath,
initOptions: { bits: 512 },
disposable: false,
start: true
Expand All @@ -46,8 +46,8 @@ describe('config endpoint', () => {
ipfs = ipfsd.api

updatedConfig = () => {
const file = fs.readFileSync(path.join(__dirname, '../repo-tests-run/config'))
return JSON.parse(file, 'utf8')
const config = fs.readFileSync(path.join(__dirname, '../repo-tests-run/config'))
return JSON.parse(config, 'utf8')
}

done()
Expand All @@ -56,7 +56,7 @@ describe('config endpoint', () => {
})

after((done) => {
rimraf(repoTests, (err) => {
rimraf(repoPath, (err) => {
expect(err).to.not.exist()
ipfsd.stop(done)
})
Expand Down
8 changes: 4 additions & 4 deletions test/http-api/id.js
Expand Up @@ -16,19 +16,19 @@ const df = DaemonFactory.create({ exec: 'src/cli/bin.js' })

describe('id endpoint', () => {
const repoExample = path.join(__dirname, '../fixtures/go-ipfs-repo')
const repoTests = path.join(__dirname, '../repo-tests-run')
const repoPath = path.join(__dirname, '../repo-tests-run')

let ipfs = null
let ipfsd = null
before(function (done) {
this.timeout(20 * 1000)

ncp(repoExample, repoTests, (err) => {
ncp(repoExample, repoPath, (err) => {
expect(err).to.not.exist()

waterfall([
(cb) => df.spawn({
repoPath: path.join(__dirname, '../fixtures/go-ipfs-repo'),
repoPath: repoPath,
initOptions: { bits: 512 },
disposable: false,
start: true
Expand All @@ -46,7 +46,7 @@ describe('id endpoint', () => {
})

after((done) => {
rimraf(repoTests, (err) => {
rimraf(repoPath, (err) => {
expect(err).to.not.exist()
ipfsd.stop(done)
})
Expand Down

0 comments on commit 540e5f6

Please sign in to comment.