UNPKG

jsonld-signatures-merkleproof2019

Version:

A jsonld signature implementation to support MerkleProof2019 verification in Verifiable Credential context

23 lines (20 loc) 824 B
import { describe, it, expect } from 'vitest'; import ensureMerkleRootEqual from '../../src/inspectors/ensureMerkleRootEqual'; describe('Inspectors test suite', function () { describe('ensureMerkleRootEqual method', function () { describe('given it is called with similar merkleRoot & remoteHash', function () { it('should not throw an error', function () { expect(function () { ensureMerkleRootEqual('similar', 'similar'); }).not.toThrow(); }); }); describe('given it is called with different merkleRoot & remoteHash', function () { it('should throw an error', function () { expect(function () { ensureMerkleRootEqual('merkle-root', 'remote-hash'); }).toThrowError('Merkle root does not match remote hash.'); }); }); }); });