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

Commit a969c3e

Browse files
committed
Merge pull request #193 from ipfs/tests/options-block
`block stat` + tests + readme update
2 parents 4a7504f + c249f14 commit a969c3e

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ The tests folder also contains great examples that can be used to understand how
8181

8282
##### block
8383

84+
- [examples](https://github.com/ipfs/js-ipfs-api/blob/master/test/api/block.spec.js)
85+
8486
##### object
8587

8688
**Curl**

src/api/block.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const argCommand = require('../cmd-helpers').argCommand
55
module.exports = send => {
66
return {
77
get: argCommand(send, 'block/get'),
8+
stat: argCommand(send, 'block/stat'),
89
put (file, cb) {
910
if (Array.isArray(file)) {
1011
return cb(null, new Error('block.put() only accepts 1 file'))

test/api/block.spec.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,13 @@ describe('.block', () => {
2525
})
2626
})
2727
})
28+
29+
it('block.stat', done => {
30+
apiClients['a'].block.stat(blorbKey, (err, res) => {
31+
expect(err).to.not.exist
32+
expect(res).to.have.property('Key')
33+
expect(res).to.have.property('Size')
34+
done()
35+
})
36+
})
2837
})

0 commit comments

Comments
 (0)