From bd19ae14ac77b512683c44426208fd168c5a0cd5 Mon Sep 17 00:00:00 2001 From: Andrew Jones Date: Sun, 22 Sep 2024 12:31:55 -0400 Subject: [PATCH] Use createSuites in 50 issuer spec. --- test/50-issue.spec.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/test/50-issue.spec.js b/test/50-issue.spec.js index 444d02ed..74736586 100644 --- a/test/50-issue.spec.js +++ b/test/50-issue.spec.js @@ -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'; @@ -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({