Skip to content
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.

Commit

Permalink
chore: improve code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Gozala committed Oct 14, 2020
1 parent 6c290fd commit 0b6c423
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,18 @@ describe('block', () => {
})

it('create', () => {
const b = new Block(uint8ArrayFromString('hello'), new CID('QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n'))
const cid = new CID('QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n')
const data = uint8ArrayFromString('hello')
const b = new Block(data, cid)

expect(Block.isBlock(b)).to.eql(true)
expect(b.toString()).to.eql('[object Block]')
expect(b.data).to.eql(data)
expect(b.cid).to.eql(cid)
expect(b._data).to.eql(data)
expect(b._data).to.eql(data)
expect(b._cid).to.eql(cid)
expect(b._cid).to.eql(cid)
})

it('block stays immutable', () => {
Expand Down

0 comments on commit 0b6c423

Please sign in to comment.