mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
fix tests
This commit is contained in:
parent
13f9f9a143
commit
e6864d9fd0
@ -4,14 +4,14 @@ import DID from '../../../src/ocean/DID'
|
|||||||
describe('DID', () => {
|
describe('DID', () => {
|
||||||
describe('#generate()', () => {
|
describe('#generate()', () => {
|
||||||
it('should generate a new did', () => {
|
it('should generate a new did', () => {
|
||||||
const did: DID = DID.generate()
|
const did: DID = DID.generate('0x8248b0E583B9db96Ca3764EadF36e0024035Cc3A')
|
||||||
assert(did)
|
assert(did)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('#parse()', () => {
|
describe('#parse()', () => {
|
||||||
it('should parse a valid did', () => {
|
it('should parse a valid did', () => {
|
||||||
const id = 'a'.repeat(64)
|
const id = 'a'.repeat(40)
|
||||||
const did: DID = DID.parse(`did:op:${id}`)
|
const did: DID = DID.parse(`did:op:${id}`)
|
||||||
assert(did)
|
assert(did)
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ describe('DID', () => {
|
|||||||
|
|
||||||
describe('#getDid()', () => {
|
describe('#getDid()', () => {
|
||||||
it('should return the full did', () => {
|
it('should return the full did', () => {
|
||||||
const did: DID = DID.generate()
|
const did: DID = DID.generate('0x8248b0E583B9db96Ca3764EadF36e0024035Cc3A')
|
||||||
assert(did)
|
assert(did)
|
||||||
|
|
||||||
assert(did.getDid().startsWith('did:op:'))
|
assert(did.getDid().startsWith('did:op:'))
|
||||||
@ -50,7 +50,7 @@ describe('DID', () => {
|
|||||||
|
|
||||||
describe('#getDid()', () => {
|
describe('#getDid()', () => {
|
||||||
it('should return only the id part of the did', () => {
|
it('should return only the id part of the did', () => {
|
||||||
const id = 'a'.repeat(64)
|
const id = 'a'.repeat(40)
|
||||||
const did: DID = DID.parse(`did:op:${id}`)
|
const did: DID = DID.parse(`did:op:${id}`)
|
||||||
assert(did)
|
assert(did)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user