Skip to content

Commit

Permalink
Fix missing vm test with Proxy signer.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljones15 committed Sep 22, 2024
1 parent fb060bf commit fd7fdb0
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions test/50-issue.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* Copyright (c) 2019-2024 Digital Bazaar, Inc. All rights reserved.
*/
import * as vc from '../lib/index.js';
import {createDiSuites, createSdSuites} from './helpers.js';
import {createSkewedTimeStamp, issueCredential} from './helpers.js';
import chai from 'chai';
import {documentLoader} from './testDocumentLoader.js';
Expand All @@ -21,9 +22,11 @@ for(const [suiteName, suiteOptions] of suites) {
}

function _runSuite({
cryptosuite,
version,
keyDoc,
keyType,
keyPair,
suiteName,
suites,
mockCredential,
Expand Down Expand Up @@ -70,12 +73,27 @@ function _runSuite({
verifiableCredential.proof.should.be.an('object');
should.not.exist(verifiableCredential.id, 'Expected no "vc.id".');
});
it.skip('should throw an error on missing verificationMethod', async () => {
it('should throw an error on missing verificationMethod', async () => {
const stubSignerId = {
get(target, prop) {
if(prop === 'id') {
return undefined;
}
return Reflect.get(...arguments);
}
};
const signer = new Proxy(keyPair.signer(), stubSignerId);
const suites = derived ? createSdSuites({signer, cryptosuite}) : createDiSuites({signer, cryptosuite});
let error;
try {
await vc.issue({
await issueCredential({
credential: mockCredential(),
suite
derived,
suites,
mandatoryPointers,
selectivePointers,
issuer: keyDoc.controller,
documentLoader
});
} catch(e) {
error = e;
Expand Down

0 comments on commit fd7fdb0

Please sign in to comment.