Skip to content

Commit 6a0e285

Browse files
author
gabe
committed
update tests
1 parent 1a95c85 commit 6a0e285

File tree

4 files changed

+74
-4
lines changed

4 files changed

+74
-4
lines changed

.eslintrc.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ module.exports = {
2727
'react',
2828
],
2929
'rules': {
30-
'no-invalid-this': 'off',
31-
'max-len': [
30+
'no-invalid-this': 'off',
31+
'max-len': [
3232
'error',
3333
{
3434
'code': 100,
File renamed without changes.

tests/jsonschema.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const schemaVersions = Object.keys(JsonSchemaVersions);
99
const should = chai.should();
1010
schemaVersions.forEach((schemaVersion) => {
1111
const schemaVersionName = JsonSchemaVersions[schemaVersion];
12-
describe(`JSON Schema ${schemaVersionName} - JsonSchema`, function() {
12+
describe(`JsonSchema – JSON Schema ${schemaVersionName}`, function() {
1313
const impls = implementationsWhichSupportVersionAndType(
1414
{version: schemaVersionName, type: VcJsonSchemaTypes.JsonSchema});
1515
const implNames = impls.map((i) => i.name);
@@ -45,7 +45,7 @@ schemaVersions.forEach((schemaVersion) => {
4545
it('3.1.2, 4 The $schema property MUST be present in each schema', function() {
4646
});
4747

48-
it('4 Conformant implementers MUST support JSON Schema specification versions marked as required in the table defined (2020-12)', function() {
48+
it('4 Conformant implementers MUST support JSON Schema specification versions marked as required in the table defined', function() {
4949
});
5050

5151
it('4.1 Validation of the integrity of the schema MUST be done before evaluation.', function() {

tests/jsonschemacredential.js

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import chai from 'chai';
2+
3+
import {
4+
implementationsWhichSupportVersionAndType, JsonSchemaVersions, VcJsonSchemaTypes,
5+
} from '../implementations/index.js';
6+
import {generateTestResult, checkTestResult, TestResult} from './testutil.js';
7+
8+
const schemaVersions = Object.keys(JsonSchemaVersions);
9+
const should = chai.should();
10+
schemaVersions.forEach((schemaVersion) => {
11+
const schemaVersionName = JsonSchemaVersions[schemaVersion];
12+
describe(`JsonSchemaCredential – JSON Schema ${schemaVersionName}`, function() {
13+
const impls = implementationsWhichSupportVersionAndType(
14+
{version: schemaVersionName, type: VcJsonSchemaTypes.JsonSchemaCredential});
15+
const implNames = impls.map((i) => i.name);
16+
this.matrix = true;
17+
this.report = true;
18+
this.implemented = [...implNames];
19+
this.rowLabel = 'Test Name';
20+
this.columnLabel = 'Implementation';
21+
22+
// run tests for each impl
23+
for (const i of impls) {
24+
describe(i.name, function() {
25+
it('1 - Passes sanity tests', function() {
26+
this.test.cell = {columnId: i.name, rowId: this.test.title};
27+
generateTestResult(i.name, schemaVersionName, VcJsonSchemaTypes.JsonSchema, '1');
28+
const result = checkTestResult(i.name, schemaVersionName, VcJsonSchemaTypes.JsonSchema, '1');
29+
should.equal(result, TestResult.success);
30+
});
31+
32+
it('2.1 ID - The value MUST be a URL that identifies the schema associated with the verifiable credential.', function() {
33+
});
34+
35+
it('2.1 The type property MUST be JsonSchemaCredential.', function() {
36+
});
37+
38+
it('3 Implementers MUST provide support for JSON Schema specifications where, in the following table, the required column\'s value is yes', function() {
39+
});
40+
41+
it('3.1.1 The $id MUST be present and its value MUST represent a valid URI-reference', function() {
42+
});
43+
44+
// NOTE: this also covers the normative guidance in 4 -- Schemas without a $schema property are not considered valid and MUST NOT be processed.
45+
it('3.1.2, 4 The $schema property MUST be present in each schema', function() {
46+
});
47+
48+
it('4 Conformant implementers MUST support JSON Schema specification versions marked as required in the table defined', function() {
49+
});
50+
51+
it('4.1 Validation of the integrity of the schema MUST be done before evaluation.', function() {
52+
53+
});
54+
55+
it('4.2 (Success) Validation MUST result in one of the following three possible outcomes: success, failure, or indeterminate.', function() {
56+
57+
});
58+
59+
it('4.2 (Failure) Validation MUST result in one of the following three possible outcomes: success, failure, or indeterminate.', function() {
60+
61+
});
62+
63+
it('4.2 (Indeterminate) Validation MUST result in one of the following three possible outcomes: success, failure, or indeterminate. ' +
64+
'Implementers MUST return this outcome when they encounter a schema whose version they do not support.', function() {
65+
66+
});
67+
});
68+
}
69+
});
70+
});

0 commit comments

Comments
 (0)