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

Commit

Permalink
test: 100% coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Apr 17, 2016
1 parent 4106e53 commit 773913d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,22 @@ describe('multihashing', () => {
new Buffer('134014f301f31be243f34c5668937883771fa381002f1aaa5f31b3f78e500b66ff2f4f8ea5e3c9f5a61bd073e2452c480484b02e030fb239315a2577f7ae156af177', 'hex')
)
})

it('cuts the length', () => {
const buf = new Buffer('beep boop')

expect(
multihashing(buf, 'sha2-256', 10)
).to.be.eql(
new Buffer('120a90ea688e275d58056732', 'hex')
)
})

it('throws on non implemented func', () => {
expect(
() => multihashing(new Buffer('beep boop'), 'blake2b')
).to.throw(
/not yet supported/
)
})
})

0 comments on commit 773913d

Please sign in to comment.