Skip to content

Commit

Permalink
Use createSuites in 50 issuer spec.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljones15 committed Sep 22, 2024
1 parent d1e5a9f commit c63b097
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions test/50-issue.spec.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/*!
* 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';
import {createSuites} from './helpers.js';
import {setupSuites} from './mocks/suites.js';
import {v4 as uuid} from 'uuid';
import {versionedCredentials} from './mocks/credential.js';
Expand Down Expand Up @@ -82,8 +81,21 @@ function _runSuite({
return Reflect.get(...arguments);
}
};
const signer = new Proxy(keyPair.signer(), stubSignerId);
const suites = derived ? createSdSuites({signer, cryptosuite}) : createDiSuites({signer, cryptosuite});
const stubSigner = {
get(target, prop) {
if(prop === 'signer') {
return () => new Proxy(target.signer(), stubSignerId);
}
return Reflect.get(...arguments);
}
};
const proxyKeyPair = new Proxy(keyPair, stubSigner);
const suites = createSuites({
keyPair: proxyKeyPair,
cryptosuite,
suiteName,
derived
});
let error;
try {
await issueCredential({
Expand Down

0 comments on commit c63b097

Please sign in to comment.