Skip to content

Commit 1f5c835

Browse files
committed
Add test for error propagation.
1 parent 60f6eff commit 1f5c835

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

suites/create.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,19 @@ export function runDataIntegrityProofFormatTests({
245245
reason: 'Expected issuer to error when VC has an undefined term.'
246246
});
247247
});
248+
it('If the algorithm produces an error, the error MUST be propagated ' +
249+
'and SHOULD convey the error type.', async function() {
250+
this.test.link = 'https://w3c.github.io/vc-data-integrity/#dfn-input-document:~:text=If%20the%20algorithm%20produces%20an%20error%2C%20the%20error%20MUST%20be%20propagated%20and%20SHOULD%20convey%20the%20error%20type';
251+
const noSubject = structuredClone(credential);
252+
delete noSubject.credentialSubject;
253+
// FIXME this test should look for a propagated error such as
254+
// PROOF_GENERATION_ERROR
255+
await shouldFailIssuance({
256+
credential: noSubject,
257+
issuer,
258+
reason: 'Expected issuer to error when VC has no credentialSubject.'
259+
});
260+
});
248261
if(cryptosuiteName) {
249262
it('The value of the cryptosuite property MUST be a string that ' +
250263
'identifies the cryptographic suite.', async function() {

0 commit comments

Comments
 (0)