Skip to content

Commit

Permalink
Update tag to be configurable via env variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
JSAssassin committed Jan 12, 2024
1 parent 8a18d62 commit f866a36
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
5 changes: 3 additions & 2 deletions tests/10-create.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import {
import {endpoints} from 'vc-test-suite-implementations';
import {generateTestData} from './vc-generator/index.js';
import {klona} from 'klona';
import {tag} from './test-config.js';
import {v4 as uuidv4} from 'uuid';

// only use implementations with `Ed25519 2020` issuers.
const tag = 'Ed25519Signature2020';
const {match} = endpoints.filterByTag({tags: [tag], property: 'issuers'});
const should = chai.should();

Expand Down Expand Up @@ -43,7 +44,7 @@ describe('Ed25519Signature2020 (create)', function() {
before(async function() {
const [issuer] = endpoints;
verifier = implementation.verifiers.find(
verifier => verifier.tags.has('Ed25519Signature2020'));
verifier => verifier.tags.has(tag));
const {settings: {id: issuerId, options}} = issuer;
const body = {credential: klona(validVc), options};
body.credential.id = `urn:uuid:${uuidv4()}`;
Expand Down
5 changes: 3 additions & 2 deletions tests/20-verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import {
import {endpoints} from 'vc-test-suite-implementations';
import {generateTestData} from './vc-generator/index.js';
import {klona} from 'klona';
import {tag} from './test-config.js';

// only use implementations with `Ed25519 2020` verifiers.
const {match} = endpoints.filterByTag({
tags: ['Ed25519Signature2020'],
tags: [tag],
property: 'verifiers'
});

Expand Down Expand Up @@ -43,7 +44,7 @@ describe('Ed25519Signature2020 (verify)', function() {
for(const [name, {implementation}] of match) {
describe(name, function() {
const verifier = implementation.verifiers.find(
verifier => verifier.tags.has('Ed25519Signature2020'));
verifier => verifier.tags.has(tag));
it('MUST verify a valid VC with an Ed25519Signature2020 proof',
async function() {
this.test.cell = {
Expand Down
4 changes: 2 additions & 2 deletions tests/30-interop.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import chai from 'chai';
import {filterByTag} from 'vc-test-suite-implementations';
import {generateTestData} from './vc-generator/index.js';
import {klona} from 'klona';
import {tag} from './test-config.js';
import {v4 as uuidv4} from 'uuid';

const should = chai.should();
const tag = 'Ed25519Signature2020';

// only use implementations with `Ed25519 2020` issuers.
const {
Expand Down Expand Up @@ -36,7 +36,7 @@ describe('Ed25519Signature2020 (interop)', function() {
let issuerError;
before(async function() {
const issuer = issuers.find(issuer =>
issuer.tags.has('Ed25519Signature2020'));
issuer.tags.has(tag));
const {settings: {id: issuerId, options}} = issuer;
const body = {credential: klona(validVc), options};
body.credential.id = `urn:uuid:${uuidv4()}`;
Expand Down
6 changes: 6 additions & 0 deletions tests/test-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*!
* Copyright (c) 2022-2024 Digital Bazaar, Inc.
* SPDX-License-Identifier: BSD-3-Clause
*/

export const tag = process.env.TAG || 'Ed25519Signature2020';

0 comments on commit f866a36

Please sign in to comment.