Skip to content

Commit

Permalink
Separate Data Integrity and Suite specific tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
aljones15 committed Jun 3, 2024
1 parent 8a8a4f5 commit bbfe0c1
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 28 deletions.
21 changes: 21 additions & 0 deletions tests/05-di-rdfc-create.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*!
* Copyright (c) 2022-2024 Digital Bazaar, Inc.
* SPDX-License-Identifier: BSD-3-Clause
*/
import {
checkDataIntegrityProofFormat
} from 'data-integrity-test-suite-assertion';
import {config} from './helpers.js';
import {endpoints} from 'vc-test-suite-implementations';

const cryptosuite = 'eddsa-rdfc-2022';
const {tags} = config.suites[cryptosuite];
const {match} = endpoints.filterByTag({
tags: [...tags],
property: 'issuers'
});

checkDataIntegrityProofFormat({
implemented: match,
testDescription: 'Data Integrity (eddsa-rdfc-2022 issuers)'
});
7 changes: 0 additions & 7 deletions tests/10-rdfc-create.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ import {
bs58Decode, config, createInitialVc, getPublicKeyBytes, shouldBeBs58
} from './helpers.js';
import chai from 'chai';
import {
checkDataIntegrityProofFormat
} from 'data-integrity-test-suite-assertion';
import {documentLoader} from './documentLoader.js';
import {endpoints} from 'vc-test-suite-implementations';
import {from as fromEncodedMultikey} from '@digitalbazaar/ed25519-multikey';
Expand All @@ -28,10 +25,6 @@ describe('eddsa-rdfc-2022 (create)', function() {
const credentials = await generateTestData();
validVc = credentials.clone('validVc');
});
checkDataIntegrityProofFormat({
implemented: match,
testDescription: 'Data Integrity (eddsa-rdfc-2022 issuers)'
});
describe('eddsa-rdfc-2022 (issuer)', function() {
this.matrix = true;
this.report = true;
Expand Down
21 changes: 21 additions & 0 deletions tests/15-di-rdfc-verify.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*!
* Copyright (c) 2022-2024 Digital Bazaar, Inc.
* SPDX-License-Identifier: BSD-3-Clause
*/
import {
checkDataIntegrityProofVerifyErrors
} from 'data-integrity-test-suite-assertion';
import {config} from './helpers.js';
import {endpoints} from 'vc-test-suite-implementations';

// only use implementations with `eddsa-rdfc-2022` verifiers.
const {tags} = config.suites['eddsa-rdfc-2022'];
const {match} = endpoints.filterByTag({
tags: [...tags],
property: 'verifiers'
});

checkDataIntegrityProofVerifyErrors({
implemented: match,
testDescription: 'Data Integrity (eddsa-rdfc-2022 verifiers)'
});
7 changes: 0 additions & 7 deletions tests/20-rdfc-verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
*/
import {bs58Decode, bs58Encode, config} from './helpers.js';
import {verificationFail, verificationSuccess} from './assertions.js';
import {
checkDataIntegrityProofVerifyErrors
} from 'data-integrity-test-suite-assertion';
import {endpoints} from 'vc-test-suite-implementations';
import {generateTestData} from './vc-generator/index.js';

Expand All @@ -22,10 +19,6 @@ describe('eddsa-rdfc-2022 (verify)', function() {
before(async function() {
credentials = await generateTestData();
});
checkDataIntegrityProofVerifyErrors({
implemented: match,
testDescription: 'Data Integrity (eddsa-rdfc-2022 verifiers)'
});
describe('eddsa-rdfc-2022 (verifier)', function() {
// this will tell the report
// to make an interop matrix with this suite
Expand Down
21 changes: 21 additions & 0 deletions tests/35-di-jcs-create.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*!
* Copyright (c) 2024 Digital Bazaar, Inc.
* SPDX-License-Identifier: BSD-3-Clause
*/
import {
checkDataIntegrityProofFormat
} from 'data-integrity-test-suite-assertion';
import {config} from './helpers.js';
import {endpoints} from 'vc-test-suite-implementations';

const cryptosuite = 'eddsa-jcs-2022';
const {tags} = config.suites[cryptosuite];
const {match} = endpoints.filterByTag({
tags: [...tags],
property: 'issuers'
});

checkDataIntegrityProofFormat({
implemented: match,
testDescription: 'Data Integrity (eddsa-jcs-2022 issuers)'
});
7 changes: 0 additions & 7 deletions tests/40-jcs-create.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ import {
bs58Decode, config, createInitialVc, getPublicKeyBytes, shouldBeBs58
} from './helpers.js';
import chai from 'chai';
import {
checkDataIntegrityProofFormat
} from 'data-integrity-test-suite-assertion';
import {documentLoader} from './documentLoader.js';
import {endpoints} from 'vc-test-suite-implementations';
import {generateTestData} from './vc-generator/index.js';
Expand All @@ -27,10 +24,6 @@ describe('eddsa-jcs-2022 (create)', function() {
const credentials = await generateTestData();
validVc = credentials.clone('validVc');
});
checkDataIntegrityProofFormat({
implemented: match,
testDescription: 'Data Integrity (eddsa-jcs-2022 issuers)'
});
describe('eddsa-jcs-2022 (issuer)', function() {
this.matrix = true;
this.report = true;
Expand Down
21 changes: 21 additions & 0 deletions tests/45-di-jcs-verify.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*!
* Copyright (c) 2024 Digital Bazaar, Inc.
* SPDX-License-Identifier: BSD-3-Clause
*/
import {
checkDataIntegrityProofVerifyErrors
} from 'data-integrity-test-suite-assertion';
import {config} from './helpers.js';
import {endpoints} from 'vc-test-suite-implementations';

const {tags} = config.suites['eddsa-jcs-2022'];
// only use implementations with `eddsa-jcs-2022` verifiers.
const {match: verifierMatches} = endpoints.filterByTag({
tags: [...tags],
property: 'verifiers'
});

checkDataIntegrityProofVerifyErrors({
implemented: verifierMatches,
testDescription: 'Data Integrity (eddsa-jcs-2022 verifiers)'
});
7 changes: 0 additions & 7 deletions tests/50-jcs-verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
*/
import {bs58Decode, bs58Encode, config} from './helpers.js';
import {verificationFail, verificationSuccess} from './assertions.js';
import {
checkDataIntegrityProofVerifyErrors
} from 'data-integrity-test-suite-assertion';
import {createInitialVc} from './helpers.js';
import {endpoints} from 'vc-test-suite-implementations';
import {generateTestData} from './vc-generator/index.js';
Expand Down Expand Up @@ -36,10 +33,6 @@ describe('eddsa-jcs-2022 (verify)', function() {
const validVc = credentials.clone('validVc');
issuedVc = await createInitialVc({issuer, vc: validVc});
});
checkDataIntegrityProofVerifyErrors({
implemented: verifierMatches,
testDescription: 'Data Integrity (eddsa-jcs-2022 verifiers)'
});
describe('eddsa-jcs-2022 (verifier)', function() {
// this will tell the report
// to make an interop matrix with this suite
Expand Down

0 comments on commit bbfe0c1

Please sign in to comment.