mirror of
https://github.com/fluencelabs/js-peer-id
synced 2025-06-29 02:11:48 +00:00
feat: isPeerId
This commit is contained in:
@ -32,6 +32,16 @@ describe('PeerId', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('isPeerId', (done) => {
|
||||
PeerId.create((err, id) => {
|
||||
expect(err).to.not.exist()
|
||||
expect(PeerId.isPeerId(id)).to.equal(true)
|
||||
expect(PeerId.isPeerId('aaa')).to.equal(false)
|
||||
expect(PeerId.isPeerId(new Buffer('batatas'))).to.equal(false)
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
it('throws on changing the id', (done) => {
|
||||
PeerId.create((err, id) => {
|
||||
expect(err).to.not.exist()
|
||||
|
Reference in New Issue
Block a user