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

Commit

Permalink
fix: wait for put in object.patch.addLink before hook
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Alan Shaw <alan@tableflip.io>
  • Loading branch information
alanshaw committed May 29, 2018
1 parent b098c05 commit 31c52d1
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions js/src/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,6 @@ module.exports = (common) => {
let testNodeMultihash
let testNodeWithLinkMultihash
let testLink
let testLinkPlainObject

const obj = {
Data: Buffer.from('patch test object'),
Expand All @@ -699,7 +698,6 @@ module.exports = (common) => {
let node1a
let node1b
let node2
let node3

series([
(cb) => {
Expand Down Expand Up @@ -928,10 +926,10 @@ module.exports = (common) => {
}

before(() => {
return ipfs.object.put(obj, (err, node) => {
expect(err).to.not.exist()
testNodeMultihash = node.multihash
})
return ipfs.object.put(obj)
.then((node) => {
testNodeMultihash = node.multihash
})
})

it('.addLink', () => {
Expand Down

0 comments on commit 31c52d1

Please sign in to comment.