Skip to content

Commit

Permalink
move vp tests to their own folder
Browse files Browse the repository at this point in the history
  • Loading branch information
finn-tbd committed Sep 18, 2023
1 parent 841c66e commit c9d434a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/credentials/tests/verifiable-credentials.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { globSync } from 'glob';
import type { VerifiableCredentialTypeV1, CredentialSubject, Issuer } from '../src/types.js';

import { getCurrentXmlSchema112Timestamp, getFutureXmlSchema112Timestamp} from '../src/utils.js';
import { VerifiableCredential } from '../src/ssi.js';
import { VerifiableCredential, VerifiablePresentation } from '../src/ssi.js';

describe('VerifiableCredentials', () => {
it('creates a vc', () => {
Expand Down Expand Up @@ -73,9 +73,17 @@ describe('VerifiableCredentials', () => {

const validVCjsons = globSync('./tests/VCs/valid/*.json');
for(const filename of validVCjsons) {
it('loads and validates valid VC ' + filename, async () => {
it('loads and validates valid VC ' + filename, () => {
const vc = JSON.parse(fs.readFileSync(filename).toString());
VerifiableCredential.validatePayload(vc);
});
}

const validVPjsons = globSync('./tests/VPs/valid/*.json');
for(const filename of validVPjsons) {
it('loads and validates valid VP ' + filename, () => {
const vc = JSON.parse(fs.readFileSync(filename).toString());
VerifiablePresentation.validatePayload(vc);
});
}
});

0 comments on commit c9d434a

Please sign in to comment.