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

Commit

Permalink
fix: tests using files
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Dec 3, 2018
1 parent 4085089 commit f68d018
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
"go-ipfs-dep": "~0.4.18",
"hat": "0.0.3",
"ipfs": "~0.33.0",
"ipfs-api": "^26.1.2",
"ipfs-unixfs": "~0.1.16",
"ipfs-http-client": "^27.0.0",
"ipfsd-ctl": "~0.40.0",
"left-pad": "^1.3.0",
"libp2p-websocket-star-rendezvous": "~0.2.4",
Expand Down
4 changes: 2 additions & 2 deletions test/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function checkNodeTypes (daemon, file) {
expect(node.links.length).to.equal(2)

return Promise.all(
node.links.map(link => daemon.api.object.get(link.toJSON().multihash).then(child => {
node.links.map(link => daemon.api.object.get(link.toJSON().cid).then(child => {
const childMeta = UnixFs.unmarshal(child.data)

expect(childMeta.type).to.equal('raw')
Expand Down Expand Up @@ -196,7 +196,7 @@ describe('files', function () {

describe('has the same hashes for', () => {
const testHashesAreEqual = (daemon, data, options) => {
return daemon.api.files.add(data, options)
return daemon.api.add(data, options)
.then(files => files[0].hash)
}

Expand Down
4 changes: 2 additions & 2 deletions test/utils/circuit.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ exports.createGoNode = (addrs, callback) => {
const data = crypto.randomBytes(128)
exports.send = (nodeA, nodeB, callback) => {
waterfall([
(cb) => nodeA.files.add(data, cb),
(res, cb) => nodeB.files.cat(res[0].hash, cb),
(cb) => nodeA.add(data, cb),
(res, cb) => nodeB.cat(res[0].hash, cb),
(buffer, cb) => {
expect(buffer).to.deep.equal(data)
cb()
Expand Down

0 comments on commit f68d018

Please sign in to comment.