Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

fix: repo interop #29

Merged
merged 2 commits into from
Sep 4, 2018
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
35 changes: 20 additions & 15 deletions test/repo.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ function catAndCheck (api, hash, data, callback) {
})
}

// The repo was again changed on go-ipfs 0.4.16
// TODO: create spec tests for repo
describe.skip('repo', () => {
// skipping until https://github.com/ipfs/interop/issues/8 is addressed
describe('repo', () => {
if (isWindows) {
return
}
Expand Down Expand Up @@ -80,7 +77,7 @@ describe.skip('repo', () => {
})

it('read repo: js -> go', function (done) {
this.timeout(50 * 1000)
this.timeout(80 * 1000)
const dir = path.join(os.tmpdir(), hat())
const data = crypto.randomBytes(1024 * 5)

Expand All @@ -91,26 +88,34 @@ describe.skip('repo', () => {
series([
(cb) => jsDf.spawn({
repoPath: dir,
disposable: false,
initOptions: { bits: 512 }
}, cb),
(node, cb) => {
}, (err, node) => {
expect(err).to.not.exist()

jsDaemon = node
cb()
},
(cb) => jsDaemon.api.add(data, cb),
(res, cb) => {
jsDaemon.init(cb)
}),
(cb) => jsDaemon.start(cb),

(cb) => jsDaemon.api.add(data, (err, res) => {
expect(err).to.not.exist()

hash = res[0].hash
catAndCheck(jsDaemon.api, hash, data, cb)
},
}),
(cb) => jsDaemon.stop(cb),
(cb) => goDf.spawn({
repoPath: dir,
disposable: false,
initOptions: { bits: 1024 }
}, cb),
(node, cb) => {
}, (err, node) => {
expect(err).to.not.exist()

goDaemon = node
cb()
},
}),
(cb) => goDaemon.start(cb),
(cb) => catAndCheck(goDaemon.api, hash, data, cb),
(cb) => goDaemon.stop(cb)
], done)
Expand Down