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

test: 'get recursive' test #741

Merged
merged 9 commits into from
Feb 1, 2017
Merged
Show file tree
Hide file tree
Changes from 3 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
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,19 @@
"hoek": "^4.1.0",
"idb-pull-blob-store": "^0.5.1",
"ipfs-api": "^12.1.4",
"ipfs-bitswap": "^0.9.0",
"ipfs-bitswap": "^0.9.2",
"ipfs-block": "^0.5.4",
"ipfs-block-service": "^0.8.0",
"ipfs-block-service": "^0.8.1",
"ipfs-multipart": "^0.1.0",
"ipfs-repo": "^0.11.2",
"ipfs-unixfs": "^0.1.9",
"ipfs-unixfs-engine": "^0.15.0",
"ipld-resolver": "^0.4.1",
"ipfs-unixfs-engine": "^0.15.2",
"ipld-resolver": "^0.4.3",
"isstream": "^0.1.2",
"libp2p-floodsub": "0.7.1",
"joi": "^10.2.0",
"libp2p-ipfs-nodejs": "^0.17.8",
"libp2p-ipfs-browser": "^0.17.7",
"libp2p-ipfs-nodejs": "^0.17.9",
"libp2p-ipfs-browser": "^0.17.8",
"lodash.flatmap": "^4.5.0",
"lodash.get": "^4.4.2",
"lodash.has": "^4.5.2",
Expand Down Expand Up @@ -171,4 +171,4 @@
"nginnever <ginneversource@gmail.com>",
"npmcdn-to-unpkg-bot <npmcdn-to-unpkg-bot@users.noreply.github.com>"
]
}
}
8 changes: 8 additions & 0 deletions test/cli/test-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,13 @@ describe('files', () => {
].join('\n'))
})
})

it('get recursively', () => {
return ipfs('files get QmUhUuiTKkkK8J6JZ9zmj8iNHPuNfGYcszgRumzhHBxEEU').then((out) => {
const directory = path.join(process.cwd(), 'QmUhUuiTKkkK8J6JZ9zmj8iNHPuNfGYcszgRumzhHBxEEU')
expect(fs.readdirSync(directory).length).to.be.eql(8)
// TODO add assertion on content of files
Copy link
Member Author

Choose a reason for hiding this comment

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

@victorbjelkholm your turn, tests are passing :)

(also, make sure to unlink to delete that file, like the other tests do.

Copy link
Member

Choose a reason for hiding this comment

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

@pgte @diasdavid hm, it's not passing for me, getting:

  1) cli --all files with daemon off (requiring js-ipfs core directly) get recursively:

      AssertionError: expected 1 to deeply equal 8
      + expected - actual

      -1
      +8

      at ipfs.then (test/cli/test-files.js:96:56)
      at process._tickDomainCallback (internal/process/next_tick.js:129:7)

  2) cli --all files with daemon on (contacting js-ipfs through http-api) get recursively:

      AssertionError: expected 1 to deeply equal 8
      + expected - actual

      -1
      +8

      at ipfs.then (test/cli/test-files.js:96:56)
      at process._tickDomainCallback (internal/process/next_tick.js:129:7)

Seems it's only pulling down one file rather than 8...

Copy link
Member Author

Choose a reason for hiding this comment

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

Could you try again (fresh npm install)

})
})
})
})