Skip to content

Commit 9455f73

Browse files
committed
Start work on conformance setup function.
1 parent c64dc7f commit 9455f73

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

tests/suites/conformance.js

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,56 @@
22
* Copyright 2024 Digital Bazaar, Inc.
33
* SPDX-License-Identifier: BSD-3-Clause
44
*/
5+
import {assertions} from 'data-integrity-test-suite-assertion';
56

67
export function assertConformance({
7-
issuers,
88
verifiers,
99
suiteName,
1010
keyType,
1111
vcVersion,
12-
credentials
12+
credential,
13+
setup = _setup
1314
}) {
1415
describe(`${suiteName} - Conformance - VC ${vcVersion}`, function() {
1516
this.matrix = true;
1617
this.report = true;
17-
this.implemented = [...issuers];
18+
this.implemented = [...verifiers];
1819
this.rowLabel = 'Test Name';
1920
this.columnLabel = 'Implementation';
20-
for(const [name, {endpoints}] of issuers) {
21-
describe(`${name} ${keyType}`, function() {
21+
let credentials = new Map();
22+
before(async function() {
23+
credentials = await setup({credential, suiteName, keyType});
24+
});
25+
for(const [name, {endpoints}] of verifiers) {
26+
const [verifier] = endpoints;
27+
describe(`${name}: ${keyType}`, function() {
2228
beforeEach(function() {
2329
this.currentTest.cell = {
2430
rowId: this.currentTest.title,
25-
columnId: `${name} ${keyType}`
31+
columnId: this.currentTest.parent.title
2632
};
2733
});
28-
it('Specifically, all relevant normative statements in Sections 2. Data ' +
29-
'Model and 3. Algorithms of this document MUST be enforced.', function() {
34+
it('Specifically, all relevant normative statements in Sections 2. ' +
35+
'Data Model and 3. Algorithms of this document MUST be enforced.',
36+
async function() {
3037
this.test.link = 'https://w3c.github.io/vc-di-ecdsa/#:~:text=Specifically%2C%20all%20relevant%20normative%20statements%20in%20Sections%202.%20Data%20Model%20and%203.%20Algorithms%20of%20this%20document%20MUST%20be%20enforced.';
3138
});
3239
it('Conforming processors MUST produce errors when non-conforming ' +
33-
'documents are consumed.', function() {
40+
'documents are consumed.', async function() {
3441
this.test.link = 'https://w3c.github.io/vc-di-ecdsa/#:~:text=Conforming%20processors%20MUST%20produce%20errors%20when%20non%2Dconforming%20documents%20are%20consumed.';
42+
await assertions.verificationFail({
43+
verifier,
44+
credential: {},
45+
reason: 'Should '
46+
});
3547
});
3648
});
3749
}
3850
});
3951
}
52+
async function _setup({}) {
53+
// not bs58 encoded verificationMethod
54+
// type is not DataIntegrityProof
55+
// invalid cryptosuite name
4056

57+
}

0 commit comments

Comments
 (0)