This document describes the did core test suite, and summarizes the latest test results.

This document is under active development and implementers are advised against using the document unless they are directly involved with the W3C DID Working Group.

Introduction

The DID Core Specification strives to make no untestable normative statements with [[RFC2119]] Language.

This document attempts to demonstrate that all such language has been tested, and is supported by at least 2 independent implementations.

This document does not contain a comprehensive lists of normative statements made by the did core spec.

Not all statements in this document have been tested.

Terminology

Suite

A test suite is a collection of tests and a json suite configuration file.

          {
            "name": "test-suite-a",
            "a": 1,
            "b": 2
          }          
          
let { suiteConfig } = global;

if (!suiteConfig) {
  suiteConfig = require("./defaultSuiteConfig.json");
}

describe("test-suite-a", () => {
  it("suite config should have correct name", async () => {
    expect(suiteConfig.name).toBe("test-suite-a");
  });

  it("a should be 1", async () => {
    expect(suiteConfig.a).toBe(1);
  });

  it("b should be 2", async () => {
    expect(suiteConfig.b).toBe(2);
  });
});
          

Test Suites MUST have unique descriptive names.

For the purposes of the DID Core WG, the suite name is assumed to be "did-spec". However, we may choose to add additional test suites, with different names in the future.

Test suites MAY be split into positive and negative cases.

A suite is considered passing when all associated tests are passing.

Statement

Normative statements are mapped to one or more tests.

          The DID method name MUST be an ASCII lowercase string.
          
it('The DID method name MUST be an ASCII lowercase string.', () => {
  const method = did.split(':')[1];
  expect(utils.isAsciiString(method)).toBe(true);
  expect(method.toLowerCase()).toBe(method);
});
          

Tests SHOULD match normative statements in the DID Core.

Tests SHOULD reuse utility functions like isAsciiString, or decodeBase64UrlToString.

Suite Input

In order to run a test suite, a configuration file must be provided for the test file to be run against.

Multiple suites can be run at once.

For the latest version of this file, please see latest did spec suite configuration

[
  {
    "name": "did-spec",
    "didMethods": {
      "did:example": {
        "supportedContentTypes": ["application/did+json"],
        "dids": ["did:example:123"],
        "did:example:123": {
          "application/did+json": {
            "didDocument": {
              "@context": ["https://www.w3.org/ns/did/v1"],
              "id": "did:example:123",
              "verificationMethod": [
                {
                  "id": "#key-0",
                  "type": "JsonWebKey2020",
                  "controller": "did:example:123",
                  "publicKeyJwk": {
                    "kty": "OKP",
                    "crv": "Ed25519",
                    "x": "VDXDwuGKVq91zxU6q7__jLDUq8_C5cuxECgd-1feFTE"
                  }
                },
                {
                  "id": "#key-1",
                  "type": "JsonWebKey2020",
                  "controller": "did:example:123",
                  "publicKeyJwk": {
                    "kty": "OKP",
                    "crv": "X25519",
                    "x": "3kY9jl1by7pLzgJktUH-e9H6fihdVUb00-sTzkfmIl8"
                  }
                }
              ],
              "authentication": ["#key-0"],
              "assertionMethod": ["#key-0"],
              "capabilityInvocation": ["#key-0"],
              "capabilityDelegation": ["#key-0"],
              "keyAgreement": ["#key-1"]
            },
            "didDocumentMetaData": {
              "content-type": "application/did+json"
            },
            "didResolutionMetaData": {}
          }
        }
      },
      "did:Cool": {
        "supportedContentTypes": ["application/did+cool+json"],
        "dids": ["did:Cool:123"],
        "did:Cool:123": {
          "application/did+cool+json": {
            "didDocument": {
              "id": "did:Cool:123",
              "forbidden__proto__": { "vulnerable": "cool?" }
            },
            "didDocumentMetaData": {
              "content-type": "application/did+cool+json"
            },
            "didResolutionMetaData": {}
          }
        }
      }
    }
  }
]
      

Suite Output

Test results are produced by jest.

Both console and json output are provided.

{
  "suitesReportTerminal": "G1s5OTlEG1tLG1swbRtbN20bWzFtG1szMm0gUEFTUyAbWzM5bRtbMjJtG1syN20bWzBtIBtbMm1zdWl0ZXMvdGVzdC1zdWl0ZS1hLxtbMjJtG1sxbXRlc3Qtc3VpdGUtYS5zcGVjLmpzG1syMm0KICB0ZXN0LXN1aXRlLWEKICAgIBtbMzJt4pyTG1szOW0gG1sybXN1aXRlIGNvbmZpZyBzaG91bGQgaGF2ZSBjb3JyZWN0IG5hbWUgKDEgbXMpG1syMm0KICAgIBtbMzJt4pyTG1szOW0gG1sybWEgc2hvdWxkIGJlIDEbWzIybQogICAgG1szMm3inJMbWzM5bSAbWzJtYiBzaG91bGQgYmUgMhtbMjJtCgobWzk5OUQbW0sbWzFtVGVzdCBTdWl0ZXM6IBtbMjJtG1sxbRtbMzJtMSBwYXNzZWQbW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zc3Vlci1hcGkKICAgIBtbMzJt4pyTG1szOW0gG1sybXN1aXRlIGNvbmZpZyBzaG91bGQgaGF2ZSBjb3JyZWN0IG5hbWUbWzIybQogICAgG1szMm3inJMbWzM5bSAbWzJtZW5kcG9pbnQgbXVzdCBjb250YWluIC9pc3N1ZS9jcmVkZW50aWFscxtbMjJtCiAgICAbWzMybeKckxtbMzltIBtbMm12ZXJpZmljYXRpb25NZXRob2RzIG11c3QgYmUgZ3JlYXRlciB0aGFuIDEgKDEgbXMpG1syMm0KICAgIBtbMzJt4pyTG1szOW0gG1sybWNyZWRlbnRpYWxzIG11c3QgYmUgYXQgbGVhc3QgMRtbMjJtCiAgICAbWzMybeKckxtbMzltIBtbMm1jYW4gaXNzdWUgYWxsIGNyZWRlbnRpYWxzIGZyb20gYWxsIHZlcmlmaWNhdGlvbk1ldGhvZHMgKDY0NCBtcykbWzIybQoKG1s5OTlEG1tLG1sxbVRlc3QgU3VpdGVzOiAbWzIybRtbMW0bWzMybTEgcGFzc2VkG1szOW0bWzIybSwgMSB0b3RhbAobWzFtVGVzdHM6ICAgICAgIBtbMjJtG1sxbRtbMzJtNSBwYXNzZWQbWzM5bRtbMjJtLCA1IHRvdGFsChtbMW1TbmFwc2hvdHM6ICAgG1syMm0wIHRvdGFsChtbMW1UaW1lOhtbMjJtICAgICAgICAwLjk3OCBzLCBlc3RpbWF0ZWQgNCBzChtbMm1SYW4gYWxsIHRlc3Qgc3VpdGVzG1syMm0bWzJtLhtbMjJtCg==",
  "suitesReportJson": [
    {
      "suite": "test-suite-a",
      "testResults": [
        {
          "ancestors": ["test-suite-a"],
          "title": "suite config should have correct name",
          "status": "passed"
        },
        {
          "ancestors": ["test-suite-a"],
          "title": "a should be 1",
          "status": "passed"
        },
        {
          "ancestors": ["test-suite-a"],
          "title": "b should be 2",
          "status": "passed"
        }
      ]
    },
    {
      "suite": "test-suite-b",
      "testResults": [
        {
          "ancestors": ["test-suite-b"],
          "title": "suite config should have correct name",
          "status": "passed"
        },
        {
          "ancestors": ["test-suite-b"],
          "title": "x should be 3",
          "status": "passed"
        },
        {
          "ancestors": ["test-suite-b"],
          "title": "y should be 4",
          "status": "passed"
        }
      ]
    }
  ]
}                   

The member suitesReportTerminal contains encoded captures from standard out and error, and can be safely ignored.

Method Conformance

See latest report json. here

      [
      {
        "suite": "did-spec",
        "testResults": [
          {
            "ancestors": [
              "did-spec",
              "did:example",
              "did-syntax",
              "did:example:123"
            ],
            "title": "MUST be a valid URL.",
            "status": "passed"
          },
          {
            "ancestors": [
              "did-spec",
              "did:example",
              "did-syntax",
              "did:example:123"
            ],
            "title": "The URI scheme MUST be \"did:\"",
            "status": "passed"
          },
          {
            "ancestors": [
              "did-spec",
              "did:example",
              "did-syntax",
              "did:example:123"
            ],
            "title": "The DID method name MUST be an ASCII lowercase string.",
            "status": "passed"
          },
          {
            "ancestors": [
              "did-spec",
              "did:example",
              "did-syntax",
              "did:example:123"
            ],
            "title": "The DID method name MUST NOT be empty.",
            "status": "passed"
          },
          {
            "ancestors": [
              "did-spec",
              "did:example",
              "did-parameters",
              "hl"
            ],
            "title": "The associated value MUST be an ASCII string.",
            "status": "passed"
          },
          {
            "ancestors": [
              "did-spec",
              "did:example",
              "did-parameters",
              "service"
            ],
            "title": "The associated value MUST be an ASCII string.",
            "status": "passed"
          },
          {
            "ancestors": [
              "did-spec",
              "did:example",
              "did-parameters",
              "relative-ref"
            ],
            "title": "The associated value MUST be an ASCII string.",
            "status": "passed"
          },
          {
            "ancestors": [
              "did-spec",
              "did:example",
              "did-parameters",
              "relative-ref"
            ],
            "title": "MUST use percent-encoding for certain characters as specified in RFC3986 Section 2.1.",
            "status": "passed"
          },
          {
            "ancestors": [
              "did-spec",
              "did:example",
              "did-parameters",
              "version-id"
            ],
            "title": "The associated value MUST be an ASCII string.",
            "status": "passed"
          },
          {
            "ancestors": [
              "did-spec",
              "did:example",
              "did-parameters",
              "version-time"
            ],
            "title": "The associated value MUST be an ASCII string.",
            "status": "passed"
          },
          {
            "ancestors": [
              "did-spec",
              "did:example",
              "resolution",
              "did:example:123",
              "application/did+json",
              "id"
            ],
            "title": "MUST be the same as the resolved ID",
            "status": "passed"
          },
          {
            "ancestors": [
              "did-spec",
              "did:example",
              "resolution",
              "did:example:123",
              "application/did+json",
              "canonicalId"
            ],
            "title": "MUST be of the same DID Method as the resolved ID",
            "status": "passed"
          },
          {
            "ancestors": [
              "did-spec",
              "did:example",
              "resolution",
              "did:example:123",
              "application/did+json",
              "canonicalId"
            ],
            "title": "MUST be recognized as the primary ID reference",
            "status": "passed"
          },
          {
            "ancestors": [
              "did-spec",
              "did:example",
              "resolution",
              "did:example:123",
              "application/did+json",
              "canonicalId"
            ],
            "title": "If the resolved ID differs from canonicalId, it must be recognized as an equivalent reference",
            "status": "passed"
          },
          {
            "ancestors": [
              "did-spec",
              "did:example",
              "resolution",
              "did:example:123",
              "application/did+json",
              "equivalentId"
            ],
            "title": "MUST be of the same DID Method as the resolved ID",
            "status": "passed"
          },
          {
            "ancestors": [
              "did-spec",
              "did:example",
              "resolution",
              "did:example:123",
              "application/did+json",
              "equivalentId"
            ],
            "title": "Its values must be recognized as equivalent ID references.",
            "status": "passed"
          },
          {
            "ancestors": [
              "did-spec",
              "did:example",
              "resolution",
              "did:example:123",
              "application/did+json",
              "equivalentId"
            ],
            "title": "Resolved ID must be recognized as the primary reference, absent a specified canonicalId",
            "status": "passed"
          },
          {
            "ancestors": [
              "did-spec",
              "did:example",
              "resolution",
              "did:example:123",
              "application/did+ld+json",
              "id"
            ],
            "title": "MUST be the same as the resolved ID",
            "status": "passed"
          },
          {
            "ancestors": [
              "did-spec",
              "did:example",
              "did-json-production"
            ],
            "title": "Numeric values representable as IEEE754 MUST be represented as a Number type.",
            "status": "todo"
          },
          {
            "ancestors": [
              "did-spec",
              "did:example",
              "did-json-production"
            ],
            "title": "Boolean values MUST be represented as a Boolean literal.",
            "status": "todo"
          },
          {
            "ancestors": [
              "did-spec",
              "did:example",
              "did-json-production"
            ],
            "title": "Sequence value MUST be represented as an Array type.",
            "status": "todo"
          },
          {
            "ancestors": [
              "did-spec",
              "did:example",
              "did-json-production"
            ],
            "title": "Unordered sets of values MUST be represented as an Array type.",
            "status": "todo"
          },
          {
            "ancestors": [
              "did-spec",
              "did:example",
              "did-json-production"
            ],
            "title": "Sets of properties MUST be represented as an Object type.",
            "status": "todo"
          },
          {
            "ancestors": [
              "did-spec",
              "did:example",
              "did-json-production"
            ],
            "title": "Empty values MUST be represented as a null literal.",
            "status": "todo"
          }
        ]
      }
    ]
      

On Demand

On demand conformance results from a remote server.


This feature is experimental and may be removed in the future.

Details related to your remote test run will be shown here:

Method Conformance